How to understand what should be stored in the state and what should be derived from that state. And also how to understand there isn't need in useEffect hook.
https://kentcdodds.com/blog/dont-sync-state-derive-it