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

React dev warning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>. #1741

Open
morremeyer opened this issue Aug 4, 2024 · 0 comments
Labels
bug Something isn't working as supposed to

Comments

@morremeyer
Copy link
Member

morremeyer commented Aug 4, 2024

Describe the bug

We are nesting two links, which is a violation of the HTML 5 spec.

Outer:


Inner:

This leads to errors in the console when developing:

Warning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>.
a
LinkWithRef@http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=974dd5ae:4885:7
a
LinkWithRef@http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=974dd5ae:4885:7
li
ul
div
BudgetSwitch@http://localhost:3000/src/components/BudgetSwitch.tsx:35:17
RenderedRoute@http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=974dd5ae:3656:7
Outlet@http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=974dd5ae:4024:20
div
div
main
div
div
Layout@http://localhost:3000/src/components/Layout.tsx:42:16
RenderedRoute@http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=974dd5ae:3656:7
Routes@http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=974dd5ae:4090:7
Router@http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=974dd5ae:4038:7
BrowserRouter@http://localhost:3000/node_modules/.vite/deps/react-router-dom.js?v=974dd5ae:4778:7
App@http://localhost:3000/src/App.tsx:48:31
@morremeyer morremeyer added the bug Something isn't working as supposed to label Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as supposed to
Projects
None yet
Development

No branches or pull requests

1 participant