I found the next elegant way in modern react
const [iover, toggleIover] = useReducer((prev) => !prev, false)