Skip to content

Commit 5dc3e9e

Browse files
author
Ives van Hoorne
committed
Fix nextState check for CodeMirror
1 parent fb1006c commit 5dc3e9e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/components/sandbox/CodeEditor/CodeMirror.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,16 @@ const handleError = (
188188
}
189189
};
190190

191+
type State = {
192+
fuzzySearchEnabled: boolean,
193+
};
194+
191195
export default class CodeEditor extends React.PureComponent<Props, State> {
192196
state = {
193197
fuzzySearchEnabled: false,
194198
};
195199

196-
shouldComponentUpdate(nextProps: Props) {
200+
shouldComponentUpdate(nextProps: Props, nextState: State) {
197201
if (nextState.fuzzySearchEnabled !== this.state.fuzzySearchEnabled) {
198202
return true;
199203
}

0 commit comments

Comments
 (0)