3 ms·
Don't forget the mandatory destructuring on the other side const [state, toggle] = useToggle() otherwise you'll end up causing unnecessary re-renders. Hap
by ricardobeat 4y ago
Don't forget the mandatory destructuring on the other side
const [state, toggle] = useToggle()
otherwise you'll end up causing unnecessary re-renders. Happens too often on hooks returning objects. You can also memoize the whole hook.
I miss classes sometimes.