Skip to content

Commit fdb131b

Browse files
fix(remix): resolve hydration error by wrapping app in layout
The root App component was missing the Layout wrapper, causing a mismatch between the server-rendered and client-rendered HTML. This resulted in a React hydration error. This change wraps the Outlet in the Layout component to ensure the base HTML structure is consistent, resolving the hydration failure.
1 parent 4cfc5e3 commit fdb131b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/root.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ export const links: LinksFunction = () => [
3232

3333
// 👇 This is what entry.server.tsx expects to exist
3434
export default function App() {
35-
return <Outlet />;
35+
return (
36+
<Layout>
37+
<Outlet />
38+
</Layout>
39+
);
3640
}
3741

3842
export function Layout({ children }: { children: ReactNode }) {

0 commit comments

Comments
 (0)