fix(mui): prevent nested anchors in ThemedTitle#7422
Open
07ReuelBodhak wants to merge 1 commit into
Open
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
ThemedTitlein@refinedev/muirenders Refine'sLinkas the outer navigation element and MUI'sLinkas the inner element.Since both render as
<a>tags by default, the output becomes invalid nested anchor HTML:This causes a React 19 hydration error in Next.js:
What is the new behavior?
The inner
MuiLinknow renders as adivby usingcomponent="div".This keeps the outer Refine
Linkresponsible for navigation while preventing nested<a>tags.The resulting HTML is now valid:
I verified this with a Next.js 16 + React 19 reproduction app:
<a>error:<a> cannot be a descendant of <a>.<a>warning no longer appears.Fixes #7418
Notes for reviewers
No docs were added because this is a small internal rendering fix.
No test was added because I could not find an existing targeted test setup for this component. The change was manually verified using the reproduction steps from the linked issue.