Skip to main content

ContentWrapper

The ContentWrapper component fetches and provides user-generated content data using a render function pattern. It accepts either a publicId or externalId to identify the content, and passes the resolved content along with loading state to a child render function.

If content is not set (and loading is false), the ID was either not found or the content has been moderated and will not be shown. Users will always be able to see their own content.

Use ContentWrapper when you need full control over how content is rendered. For a simpler image-specific wrapper, see ImageContentWrapper.

Note

Content rendered through ContentWrapper is wrapped in a ContentMonitor that allows users to report it for moderation.

Anchor to children
children
({ content, loading, }: { content?: ; loading: boolean; }) => Element
required

A render function that receives the content data and loading state, and returns a React element.

Anchor to externalId
externalId
string

The external ID of the content item (use this OR publicId).

Anchor to publicId
publicId
string

The public ID of the content item (use this OR externalId).



Was this page helpful?