reagir o estado booleano de alternar
const [check, setCheck] = useState(false);
// ...
setCheck(prevCheck => !prevCheck);
Stupid Skylark
const [check, setCheck] = useState(false);
// ...
setCheck(prevCheck => !prevCheck);
this.setState(prevState => ({
check: !prevState.check
}));