36 - Usestate Hook With Object
36 - Usestate Hook With Object
useState Hook
With Object
PRESENTER: MOHAMMAD ADIL
REACT
useState Hook REACT
• Because we need the current value of state, we pass a function into our
setPerson function. This function receives the previous value.
• We then return an object, spreading the previousState and overwriting
only the name.