Skip to content

Conversation

bytrangle
Copy link
Contributor

Description

Probably fixes #316

When fullPage of component <NotionRenderer> is omitted or set to false, both className and bodyClassName are assigned to the <main> element.

<main
              className={cs(
                'notion',
                darkMode ? 'dark-mode' : 'light-mode',
                'notion-page',
                page_full_width && 'notion-full-width',
                page_small_text && 'notion-small-text',
                blockId,
                className
              )}
            >
</main>

I think this will:

  • defeat the purpose of having two separate props: className and bodyClassName of <NotionRenderer>.
  • take away the users' opportunity for controlling the markup with CSS.

So I wrapped the children blocks in an extra element and added bodyClassName to it.

Notion Test Page ID

@vercel
Copy link

vercel bot commented Jul 4, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-notion-x ✅ Ready (Inspect) Visit Preview Jul 4, 2022 at 8:07AM (UTC)
react-notion-x-minimal-demo ✅ Ready (Inspect) Visit Preview Jul 4, 2022 at 8:07AM (UTC)

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.

What's the purpose of bodyClassName prop in NotionRenderer when fullPage is false?
1 participant