Skip to content

Conversation

pyk
Copy link
Contributor

@pyk pyk commented Feb 14, 2021

I tried to create custom block components for callout, but currently createRenderChildText is not exported.

With this small changes, I can do the following now:

import { NotionRenderer, createRenderChildText } from "react-notion";

// ...

const notionRenderChildText = createRenderChildText();

// Component
<NotionRenderer
    blockMap={notionBlocks ?? {}}
    customBlockComponents={{
        callout: ({ blockValue, renderComponent }) => (
            <div className="custom-class">
                {notionRenderChildText(blockValue.properties.title)}
            </div>
        ),
    }}
/>

Thank you!

@tobiaslins tobiaslins merged commit cd1470c into splitbee:master Feb 14, 2021
@tobiaslins
Copy link
Member

Looks good, thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants