Reading Notes
Describe use cases for useMemo()
and useReducer()
. useMemo()
will only recompute memoized value if one of the dependencies has changed. useReducer()
is similar to useState()
but works better for complex state logic or if the new state depends on the previous
Why do custom hooks need the use
prefix? So that it is clear to react if a function needs to maintain all of the hook rules.
What do custom hooks usually do? Allow for the reuse of stateful logic.
Using any list of custom hooks, research and name one that you think will be useful in your applications. useEffect()
is a good way to have something happen after a render or every render
Describe how a hook that fetches API data might work. useFetch()
is a quick way to set up a fetch and provide state for isLoading