Skip to main content

Interface: BlockRendererProps

Defined in: packages/core/src/react/components/BaseBlocksRenderer.tsx:100

The type definition for the BlocksRenderer component.

Properties

blockContext?

optional blockContext: Record<string, unknown>

Defined in: packages/core/src/react/components/BaseBlocksRenderer.tsx:152

An optional context that is passed to all children components


blockStyles?

optional blockStyles: string

Defined in: packages/core/src/react/components/BaseBlocksRenderer.tsx:157

The block styles to be applied to the blocks.


children?

optional children: ReactNode

Defined in: packages/core/src/react/components/BaseBlocksRenderer.tsx:137

The children components that must implements BlockProps. Failing to implement BlockProps will issue a warning at runtime.

Passing children are not mandatory, if you do not pass them BlocksRenderer will simply sanitize the html markup.


forwardBlockAttributes?

optional forwardBlockAttributes: boolean

Defined in: packages/core/src/react/components/BaseBlocksRenderer.tsx:147

Whether to forward the block attributes to the children components.


html

html: string

Defined in: packages/core/src/react/components/BaseBlocksRenderer.tsx:110

The HTML string to be parsed.

<BlocksRenderer
html="<div><p>hello world</p> div content</div>"
/>,

ksesAllowList?

optional ksesAllowList: IWhiteList

Defined in: packages/core/src/react/components/BaseBlocksRenderer.tsx:122

The allow list for the parser, must extend the core allowed list

<BlocksRenderer
html="<div some-attribute><p>hello world</p> div content</div>"
ksesAllowList={{ { ...ksesAllowedList, div: [...ksesAllowedList.div, 'some-attribute'] }, }}
/>,

sanitizeFn()?

optional sanitizeFn: (html, ksesAllowList?) => string

Defined in: packages/core/src/react/components/BaseBlocksRenderer.tsx:129

A custom implementation of the sanitize function.

If none is provided it's going to default to wpKsesPost

Parameters

html

string

ksesAllowList?

IWhiteList

Returns

string


settings?

optional settings: HeadlessConfig

Defined in: packages/core/src/react/components/BaseBlocksRenderer.tsx:142

The headless config