> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tappify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# useTapState

> Returns one value from the in-memory store every mount of the install shares, with a setter for it.

```ts theme={null}
function useTapState<T>(key): [T | undefined, (value) => void];
```

Returns one value from the in-memory store every mount of the install shares,
with a setter for it.

## Type Parameters

### T

`T`

## Parameters

### key

`string`

## Returns

\[`T` | `undefined`, (`value`) => `void`]

## Remarks

The value is `undefined` until something sets it, and setting it re-renders
every mount reading the same key, including a sibling widget and the expand
panel. The store lives in the browser session: it is not persisted, not shared
between teammates or tabs, and never reaches Tappify or your server — use
`useTapStorage` for a value that has to come back tomorrow. Throws
`TAP_OUTSIDE_HOST` outside a mount.

## Example

```tsx theme={null}
import { TapButton, useTapState } from '@tappify/extension-sdk';

function StepPicker() {
  const [step, setStep] = useTapState<string>('selectedStep');
  return (
    <TapButton onClick={() => setStep('install')}>
      {step ?? 'Pick a step'}
    </TapButton>
  );
}
```
