Next.js Discord

Discord Forum

Hydration error despite suppressHydationError

Answered
Broken Nokia posted this in #help-forum
Open in Discord
Yes I've followed the pinned fo post, i still get these errors despite having passed the supressHydrationError attribute to the root html and body tag
Answered by Asian black bear
That attribute only prevents hydration errors for that particular element and not descendents. You have to fix your li nested inside a li instead because it's incorrect HTML.
View full answer

2 Replies

Asian black bear
That attribute only prevents hydration errors for that particular element and not descendents. You have to fix your li nested inside a li instead because it's incorrect HTML.
Answer
Giant panda
If youโ€™re using shadcn here you will need to add the asChild attribute to the parent of the problem element