An alternative to useState
.
useReducer
is usually preferable to useState
when you have complex state logic that involves
multiple sub-values. It also lets you optimize performance for components that trigger deep
updates because you can pass dispatch
down instead of callbacks.
Optional
initializer: undefinedAn alternative to useState
.
useReducer
is usually preferable to useState
when you have complex state logic that involves
multiple sub-values. It also lets you optimize performance for components that trigger deep
updates because you can pass dispatch
down instead of callbacks.
An alternative to useState
.
useReducer
is usually preferable to useState
when you have complex state logic that involves
multiple sub-values. It also lets you optimize performance for components that trigger deep
updates because you can pass dispatch
down instead of callbacks.
An alternative to useState
.
useReducer
is usually preferable to useState
when you have complex state logic that involves
multiple sub-values. It also lets you optimize performance for components that trigger deep
updates because you can pass dispatch
down instead of callbacks.
Optional
initializer: undefined
An alternative to
useState
.useReducer
is usually preferable touseState
when you have complex state logic that involves multiple sub-values. It also lets you optimize performance for components that trigger deep updates because you can passdispatch
down instead of callbacks.