open-tacos
open-tacos copied to clipboard
Duplicate html tag from extra layout in app router
Steps to Reproduce
- Load any page from the app router (eg.
https://stg.openbeta.io/pulse) - Observe in source that there are two
<html>tags - No real user facing issues, I just noticed in local dev where during clientside hydration it notices the disconnect
src/app/Layout.tsx will be used for all routes due to how layouts work. Fix should be to either:
- let root layout be the only layout that sets up
htmlandbodytags - don't have a root layout at all, and have not found setup its' own
htmlandbodytags
Screenshots
Expected Behavior
Just one html tag
Current Behavior
Two html tags
Browser & version
Chrome
Operating system
Windows
I've fixed the duplicate HTML tags issue by:
- Removing the
<html>and<body>tags fromsrc/app/(default)/layout.tsx - Keeping the HTML structure only in the root layout (
src/app/layout.tsx) - Renaming the component from
RootLayouttoDefaultLayoutfor clarity
The changes ensure that:
- Only one set of HTML/body tags exists in the page source
- The hydration process works correctly without any disconnects
- All functionality (auth, header, footer) remains intact
PR: #1314
Completed.