https://javascript.plainenglish.io/how-to-use-react-hooks-to-implement-state-management-of-complex-components-f0ad17788ee3