We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I define an inline block by returning JSX directly, there’s no issue:
inlineBlocks: { // Works fine: AvatarGroup: ({ node }) => { const { avatars } = node.fields return <div>{avatars?.map((avatar, ix) => <div key={ix}></div>)}</div> } }
But as soon as I move the same logic into a separate React component, I get a hydration error in the frontend:
inlineBlocks: { // Causes a hydration error: AvatarGroup: ({ node }) => { const { avatars } = node.fields return <AvatarGroup avatars={avatars} /> } }
Nothing else changes except encapsulating the markup in a dedicated component.
Livog/payload-3-inline-blocks-bug@5214c50
plugin: richtext-lexical
Payload: 3.18 Next.js: 15.1.5 Node.js 20.11
The text was updated successfully, but these errors were encountered:
I get the error when I put it inline too, which is this:
Unhandled Runtime Error In HTML, <div> cannot be a descendant of <p>. This will cause a hydration error. [...] ... <div> <p> ^^^ <div>
Which is expected. If you change the divs to spans it works.
For next time, please copy the full error you get so it's easier to help you
Sorry, something went wrong.
@GermanJablo I want to apologize for missing that detail. Thank you for your time and for helping me clarify it.
No problem! 😁👍🏼
GermanJablo
No branches or pull requests
Describe the Bug
When I define an inline block by returning JSX directly, there’s no issue:
But as soon as I move the same logic into a separate React component, I get a hydration error in the frontend:
Nothing else changes except encapsulating the markup in a dedicated component.
Link to the code that reproduces this issue
Livog/payload-3-inline-blocks-bug@5214c50
Reproduction Steps
Which area(s) are affected? (Select all that apply)
plugin: richtext-lexical
Environment Info
The text was updated successfully, but these errors were encountered: