Understanding React State Hooks
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.
When do you use hooks?
We call it inside a function component to add some local state to it. React will preserve this state between re-renders.
Hooks are functions that let you “hook into” React state and lifecycle features from…