-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix hydration error on V2 #3272
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
Conversation
🦋 Changeset detectedLatest commit: a4430fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of the deployments: Version 1
Version 2
Test content |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this is a solution and why we need to change CSS to fix this problem. Maybe I'm missing something, but from my understanding the only solution is to make sure that the inline link doesn't render as a <a>
.
I think the best solution is to have a React context in Link.tsx
and if it's a nested link, we instead render a <span>
with some onClick
to trigger navigation (also stop propagation). These <Link>
could also re-render after hydration to actually render a <a>
.
Inserting an inline link inside a card would cause an
<a>
tag to be nested inside another<a>
tag.This cause an hydration error in GBO v2, and initial render from the server would not render properly and the card would only appear after client hydration.