Skip to content

Commit

Permalink
Stop unnecessary state updates to prevent unnecessary rerenders (#1758)
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec authored Nov 18, 2022
1 parent 6a0e31e commit f20ae7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/DataEntry/DataEntryTable/DataEntryTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,11 @@ export class DataEntryTable extends React.Component<
this.addNewWord(word, audioFileURLs)
}
semanticDomain={this.props.semanticDomain}
setIsReadyState={(isReady: boolean) => this.setState({ isReady })}
setIsReadyState={(isReady: boolean) =>
this.setState((state) => {
return state.isReady === isReady ? null : { isReady };
})
}
recorder={this.recorder}
analysisLang={this.state.analysisLang}
vernacularLang={this.state.vernacularLang}
Expand Down

0 comments on commit f20ae7a

Please sign in to comment.