Function · Hooks and State
useState
Stores component-local state between renders.
@sharpts/gui 0.0.0-local · SharpTS 7c6010104a43Signature
TypeScript
useState(initial: T | () => T): [T, StateSetter<T>]Parameters
| Name | Type | Description |
|---|---|---|
initial | T | () => T | Initial value or a lazy initializer. |
Returns
[T, StateSetter<T>] — The current value and a state setter.
Related symbols
Source
SharpTS.Gui.Sdk/GuiPackage/runtime.ts:172 at SharpTS revision 7c6010104a43c34d80e9d44704cf179bc4f5b8e0.