Context API
Review, Research, and Discussion
- Describe use cases useState() vs useReducer()
- useState(): is better for being more precise with the data that you are trying to access from state.
- useReducer(): is better to squish and mroe compress the data of state you are using.
- Why do custom hooks need the use prefix?
- so React can tell the difference between a normal function and a react hook.
- What do custom hooks usually do?
- depending on the hook, it can do whatever it is you want to do.
- Using any list of custom hooks, research and name one that you think will be useful in your applications
- Describe how a hook that fetches API data might work
- a hook that calls an API using Axios, managing it with useState or useReducer.
Vocab
- reducer - manages change within state by handing an action.