# fromPayload

`function` in `discord-component-embed` · v0.4.1

<https://docs.seedcord.org/packages/discord-component-embed/0.4.1/functions/from-payload>

Turns a component embed's JSON back into a tree. Use it to check JSON you wrote by hand or got from somewhere else. Pass the result to [`toComponentEmbed`](/packages/discord-component-embed/0.4.1/functions/to-component-embed) or [`toComponentEmbedJson`](/packages/discord-component-embed/0.4.1/functions/to-component-embed-json). They throw the same errors they throw for a tree built with JSX.

```ts
fromPayload(payload: ComponentEmbedPayload): EmbedElement
```

Turns a component embed's JSON back into a tree. Use it to check JSON you wrote by hand or got from somewhere else. Pass the result to [`toComponentEmbed`](/packages/discord-component-embed/0.4.1/functions/to-component-embed) or [`toComponentEmbedJson`](/packages/discord-component-embed/0.4.1/functions/to-component-embed-json). They throw the same errors they throw for a tree built with JSX.

Parameters.

- `payload` `ComponentEmbedPayload`

Returns `EmbedElement`.
