Reading-Notes
code fellows 401
Read: 29 - Advanced State with Reducers
How can we ensure that an effect hook runs only once?
pass in a second param that controls how many times it can run.
Can useState() update more than one state variable at the same time?
Yes if you use object or arrays
Is useState() synchronous?
useState is asynchronous
Vocab:
State Hook: a Hook that allows you to have state variables in functional components.
Component Lifecycle: broadly classified into four parts: initialization. mounting. updating, and. unmounting.