-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Link as a descendant of other Link causes hydration error #51694
Comments
getting this as well |
It appears that nesting links is generally considered a bad practice (or even illegal). I solved my case by removing nesting and artificially increasing card link clickable area using css. Like in this article: https://css-tricks.com/nested-links/ |
Also seeing this pop up quite a bit now. I suppose nested links are bad, but I have several use cases for them – anyone have any solves here? |
I had the same issue. I think the reason is that I was using a child component inside the Not sure if that is the reason for you but that's what solved it for me. Perhaps having a |
This is expected – you should not nest |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/amazing-jennings-nyfqwl?file=%2Fapp%2Fpage.tsx%3A15%2C57
To Reproduce
I have a use case where the whole item card should be clickable Link. But also there are certain Links inside it (e.g. tags that are used to apply the search).
Describe the Bug
Error:
Expected Behavior
No error. When inner Link is clicked - navigates to inner Link. When the card is clicked (outside of inner Link), navigates to outer Link.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: