Documentation
On this page

Function · Hooks and State

useState

Stores component-local state between renders.

@sharpts/gui · SharpTS 572a2e31be0e

Signature

TypeScript
useState(initial: T | () => T): [T, StateSetter<T>]

Parameters

NameTypeDescription
initialT | () => TInitial value or a lazy initializer.

Returns

[T, StateSetter<T>] — The current value and a state setter.

Source

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