temp hack fix for state updates (#593)

* temp hack fix state updates

* switch setTimeout for state mutation
This commit is contained in:
David Luzar 2020-01-27 19:24:11 +01:00 committed by GitHub
parent a862d12ac1
commit 187cfbe2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -226,8 +226,11 @@ export class App extends React.Component<any, AppState> {
this.saveDebounced.flush(); this.saveDebounced.flush();
}; };
public shouldComponentUpdate() { public shouldComponentUpdate(props: any, nextState: AppState) {
if (!history.isRecording()) { if (!history.isRecording()) {
// temporary hack to fix #592
// eslint-disable-next-line react/no-direct-mutation-state
this.state = nextState;
this.componentDidUpdate(); this.componentDidUpdate();
return false; return false;
} }