Documentation
On this page

Function · Hooks and State

useReducer

Stores component-local state updated by a reducer.

@sharpts/gui 0.0.0-local · SharpTS 7c6010104a43

Signature

TypeScript
useReducer(reducer: (state: S, action: A) => S, initial: S): [S, Dispatch<A>]

Parameters

NameTypeDescription
reducer(state: S, action: A) => SProduces the next state from the current state and an action.
initialSInitial reducer state.

Returns

[S, Dispatch<A>] — The current state and an action dispatcher.

Source

SharpTS.Gui.Sdk/GuiPackage/runtime.ts:203 at SharpTS revision 7c6010104a43c34d80e9d44704cf179bc4f5b8e0.