# fromPayload

`function` in `discord-component-embed` · v1.0.0

<https://seedcord.org/docs/packages/discord-component-embed/1.0.0/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`](/docs/packages/discord-component-embed/1.0.0/functions/to-component-embed) or [`toComponentEmbedJson`](/docs/packages/discord-component-embed/1.0.0/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`](/docs/packages/discord-component-embed/1.0.0/functions/to-component-embed) or [`toComponentEmbedJson`](/docs/packages/discord-component-embed/1.0.0/functions/to-component-embed-json). They throw the same errors they
throw for a tree built with JSX.

Parameters.

- `payload` `ComponentEmbedPayload`

Returns `EmbedElement`.
