소스 검색

temp hack fix for state updates (#593)

* temp hack fix state updates

* switch setTimeout for state mutation
David Luzar 5 년 전
부모
커밋
187cfbe2d8
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/index.tsx

+ 4 - 1
src/index.tsx

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