React przełącz stan boolean
const [check, setCheck] = useState(false);
// ...
setCheck(prevCheck => !prevCheck);
Stupid Skylark
const [check, setCheck] = useState(false);
// ...
setCheck(prevCheck => !prevCheck);
this.setState(prevState => ({
check: !prevState.check
}));