Documentation
On this page

Function · Hooks and State

useReducer

Stores component-local state updated by a reducer.

@sharpts/gui · SharpTS 572a2e31be0e

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

src/SharpTS.Gui.Sdk/GuiPackage/runtime.ts:203 at SharpTS revision 572a2e31be0e2a09be0138bc44501b34d6245b51.