Skip to content
New issue

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

Custom prose img components will cause hydration mismatch #212

Closed
enpitsuLin opened this issue May 20, 2024 · 1 comment
Closed

Custom prose img components will cause hydration mismatch #212

enpitsuLin opened this issue May 20, 2024 · 1 comment

Comments

@enpitsuLin
Copy link

enpitsuLin commented May 20, 2024

I try override prose component <ProseImg/> to show caption under image in nuxt/content template, but got hydration mismatch warning, I thought it was cause by content module(nuxt/content#2640), but this issue also be found in MDC playground

I just add <figure/> and <figurecaption/>, after several try that I realized if there are some unexpected element wrap it would cause hydration mismatch, but cant resolve it

image

Reproduction

https://stackblitz.com/edit/github-1szhfr

@enpitsuLin
Copy link
Author

Just figured out the <figure/> is block element cant be placed in the paragraph or those elements which not flow elements

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

No branches or pull requests

1 participant