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.
Optionalinitializer: 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.
Optionalinitializer: undefined
An alternative to
useState.useReduceris usually preferable touseStatewhen 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 passdispatchdown instead of callbacks.