Open masakudamatsu opened 3 years ago
Source: https://kentcdodds.com/blog/state-colocation-will-make-your-react-app-faster#so-how-do-you-decide-where-to-put-state
useState
Task 1: Colocate states wherever possible, by following this flow chart:
Source: https://kentcdodds.com/blog/state-colocation-will-make-your-react-app-faster#so-how-do-you-decide-where-to-put-state
Task 2: Separate derived states from managed states, and avoid using
useState
for derived states.