Skip to content

Commit 75842fe

Browse files
author
Max Schaefer
authored
Merge pull request #627 from samlanning/inconsistentStateExample
JS: Fix syntax error in js/react/inconsistent-state-update example
2 parents 3c00d4b + 2ea1480 commit 75842fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javascript/ql/src/React/InconsistentStateUpdate.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ Instead, the callback form of <code>setState</code> should be used:
3636
</p>
3737

3838
<sample language="javascript">
39-
this.setState((prevState) => {
39+
this.setState((prevState) => ({
4040
counter: prevState.counter + 1
41-
});
41+
}));
4242
</sample>
4343
</example>
4444

0 commit comments

Comments
 (0)