# toComponentEmbed

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

<https://docs.seedcord.org/packages/discord-component-embed/0.1.0/functions/to-component-embed>

Converts a `<Container>` tree into the JSON document Discord reads for a component embed.

```ts
toComponentEmbed(root: ReactElement): ComponentEmbedPayload
```

Converts a `<Container>` tree into the JSON document Discord reads for a component embed.

Parameters.

- `root` `ReactElement`

Returns `ComponentEmbedPayload`.
