# useState

**Kind:** Function

**Source:** [`src/jsx/hooks/index.ts`](https://github.com/honojs/hono/blob/main/src/jsx/hooks/index.ts#L182)

**Part of:** [Jsx](subsystem-src-jsx)

## Signature

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

## Parameters

| Name | Type |
|---|---|
| `initialState` | `T | (() => 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)

- `Root` — `src/jsx/dom/client.ts`:11
- `FormContext` — `src/jsx/dom/hooks/index.ts`:24
- `clearCache` — `src/jsx/dom/intrinsic-element/components.ts`:18
