masakudamatsu / line-height-picker

A front-end web app that helps web designers/developers pick the best line-height value for their websites
https://line-height-picker.vercel.app
MIT License
2 stars 1 forks source link

Refactor state management #265

Open masakudamatsu opened 3 years ago

masakudamatsu commented 3 years ago

Task 1: Colocate states wherever possible, by following this flow chart:

where-to-put-state

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.