Desc
Just me playing around with hooks. Hooks pretty much allows you to have store state and change state in a functional component. Thus replacing class components in react. Check out the blog below to see an in-depth break down of the two. https://www.twilio.com/blog/react-choose-functional-components
Hook rules (Joshua Miles)
Rules of Hooks:
- Hooks can only be called inside of the body of a functional component
- You cannot conditionally invoke hooks
- Hooks always start with
use
useState useEffect...
useState Returns an array of 2 elements
- Your state
- A function you can use to change state
To use hooks you can just import them from React there is no additional installations required. (See the DogList.js file)
Interesting Read on Hooks and Redux
https://medium.com/javascript-scene/do-react-hooks-replace-redux-210bab340672