Skip to content

Commit

Permalink
examples: use right way to reverse state in examples code 'CheckboxWi…
Browse files Browse the repository at this point in the history
…thLabel.js' (#14184)
  • Loading branch information
cw1997 committed Jun 21, 2023
1 parent bf16169 commit 4aae8e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/react-testing-library/CheckboxWithLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function CheckboxWithLabel({labelOn, labelOff}) {
const [isChecked, setIsChecked] = useState(false);

const onChange = () => {
setIsChecked(!isChecked);
setIsChecked(draft => !draft);
};

return (
Expand Down

0 comments on commit 4aae8e9

Please sign in to comment.