Skip to content

useState

reference
1 min readUpdated

Kind: Function

Source: src/jsx/hooks/index.ts

Part of: Jsx

Signature

ts
function useState(initialState: T | (() => T)): [T, UpdateStateFunction<T>]

Parameters

NameType
initialState`T

Returns: [T, UpdateStateFunction<T>]

Used by

3 references from 3 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (3)

  • Rootsrc/jsx/dom/client.ts:11
  • FormContextsrc/jsx/dom/hooks/index.ts:24
  • clearCachesrc/jsx/dom/intrinsic-element/components.ts:18

Was this page helpful?

Download as PDF
useState — Hono (narrator proof)