Skip to main content

Interface: BlockRendererProps

@headstartwp/core.react.BlockRendererProps

The type definition for the BlocksRenderer component.

Properties

children

Optional children: ReactNode

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.

Defined in

packages/core/src/react/components/BlocksRenderer.tsx:113


html

html: string

The HTML string to be parsed.

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

Defined in

packages/core/src/react/components/BlocksRenderer.tsx:86


ksesAllowList

Optional ksesAllowList: IWhiteList

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'] }, }}
/>,

Defined in

packages/core/src/react/components/BlocksRenderer.tsx:98


sanitizeFn

Optional sanitizeFn: (html: string, ksesAllowList?: IWhiteList) => string

Type declaration

▸ (html, ksesAllowList?): string

A custom implementation of the sanitize function.

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

Parameters
NameType
htmlstring
ksesAllowList?IWhiteList
Returns

string

Defined in

packages/core/src/react/components/BlocksRenderer.tsx:105