# updateBlock (@salmonui/rich-text)

> The updateBlock function of @salmonui/rich-text: Updates one block: props are merged, type, content and children replace; or pass a function returning the new block (its id is kept).

Canonical: https://salmonui.dev/docs/reference/rich-text/updateBlock

```ts
import { updateBlock } from '@salmonui/rich-text';
```

Entry index: https://salmonui.dev/docs/reference/rich-text (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/rich-text.md).

## Reference

Kind: function

```ts
function updateBlock(blocks: readonly Block[], id: string, patch: BlockPatch | ((block: Block) => Block)): Block[];
```

Updates one block: `props` are merged, `type`, `content` and `children`
replace; or pass a function returning the new block (its id is kept).
