# hooks/useKeyedValue (zidane-ui)

Import: `import { … } from 'zidane-ui'`. Source: [ui/src/hooks/useKeyedValue.ts](https://github.com/Tahul/zidane/blob/main/ui/src/hooks/useKeyedValue.ts).

## Functions

### `useKeyedValue`

Function.

The value under `key` (`null` when unset or no key), re-rendering only when that key changes.

```ts
function useKeyedValue<V>(
  store: KeyedStore<V, unknown>,
  key: string | null | undefined,
): V | null
```

**Type parameters**

- `V`

**Parameters**

- `store` (`KeyedStore<V, unknown>`): The store to read.
- `key` (`string | null | undefined`): The key; `null` / `undefined` reads nothing.

**Returns** `V | null`

Source: [ui/src/hooks/useKeyedValue.ts:16](https://github.com/Tahul/zidane/blob/main/ui/src/hooks/useKeyedValue.ts#L16)
