Function · Hooks and State
useReducer
Stores component-local state updated by a reducer.
@sharpts/gui · SharpTS 572a2e31be0eSignature
TypeScript
useReducer(reducer: (state: S, action: A) => S, initial: S): [S, Dispatch<A>]Parameters
| Name | Type | Description |
|---|---|---|
reducer | (state: S, action: A) => S | Produces the next state from the current state and an action. |
initial | S | Initial reducer state. |
Returns
[S, Dispatch<A>] — The current state and an action dispatcher.
Related symbols
Source
src/SharpTS.Gui.Sdk/GuiPackage/runtime.ts:203 at SharpTS revision 572a2e31be0e2a09be0138bc44501b34d6245b51.