Skip to content

Commit

Permalink
Update all templates to use Layout export
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Feb 8, 2024
1 parent 6d5df54 commit c5826ce
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 26 deletions.
8 changes: 4 additions & 4 deletions docs/file-conventions/root.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ export default function App() {
{/* Child routes render here */}
<Outlet />

{/* Script tags go here */}
{/* If you use a nonce-based content security policy for scripts, you must provide the `nonce` prop. Otherwise, omit the nonce prop as shown here. */}
<Scripts />

{/* Manages scroll position for client-side transitions */}
{/* If you use a nonce-based content security policy for scripts, you must provide the `nonce` prop. Otherwise, omit the nonce prop as shown here. */}
<ScrollRestoration />

{/* Script tags go here */}
{/* If you use a nonce-based content security policy for scripts, you must provide the `nonce` prop. Otherwise, omit the nonce prop as shown here. */}
<Scripts />

{/* Sets up automatic reload when you change code */}
{/* and only does anything during development */}
{/* If you use a nonce-based content security policy for scripts, you must provide the `nonce` prop. Otherwise, omit the nonce prop as shown here. */}
Expand Down
8 changes: 6 additions & 2 deletions templates/arc/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
];

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -24,11 +24,15 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
8 changes: 6 additions & 2 deletions templates/cloudflare-pages/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
];

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -23,11 +23,15 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
8 changes: 6 additions & 2 deletions templates/cloudflare-workers/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
];

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -23,11 +23,15 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
8 changes: 6 additions & 2 deletions templates/deno/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
];

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -24,11 +24,15 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
8 changes: 6 additions & 2 deletions templates/express/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
];

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -23,11 +23,15 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
8 changes: 6 additions & 2 deletions templates/fly/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
];

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -23,11 +23,15 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
9 changes: 7 additions & 2 deletions templates/remix-javascript/app/root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const links = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
];

export default function App() {
// eslint-disable-next-line react/prop-types
export function Layout({ children }) {
return (
<html lang="en">
<head>
Expand All @@ -22,11 +23,15 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
8 changes: 6 additions & 2 deletions templates/remix/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
];

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -23,11 +23,15 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
8 changes: 6 additions & 2 deletions templates/unstable-vite-cloudflare/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ScrollRestoration,
} from "@remix-run/react";

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -16,10 +16,14 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
8 changes: 6 additions & 2 deletions templates/unstable-vite-express/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ScrollRestoration,
} from "@remix-run/react";

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -16,10 +16,14 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
8 changes: 6 additions & 2 deletions templates/unstable-vite/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ScrollRestoration,
} from "@remix-run/react";

export default function App() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
Expand All @@ -16,10 +16,14 @@ export default function App() {
<Links />
</head>
<body>
<Outlet />
{children}
<ScrollRestoration />
<Scripts />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}

0 comments on commit c5826ce

Please sign in to comment.