Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/42_react-tweet/src/entries.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPages } from 'waku';
import { new_createPages as createPages } from 'waku/router/server';

import { RootLayout } from './templates/root-layout';
import { HomePage } from './templates/home-page';
Expand Down
2 changes: 1 addition & 1 deletion examples/42_react-tweet/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StrictMode } from 'react';
import { createRoot, hydrateRoot } from 'react-dom/client';
import { Router } from 'waku/router/client';
import { NewRouter as Router } from 'waku/router/client';

const rootElement = (
<StrictMode>
Expand Down
2 changes: 1 addition & 1 deletion examples/43_weave-render/src/components/BarLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const BarLayout = ({ children }: { children: ReactNode }) => {
pending={<Pending isPending />}
notPending={<Pending isPending={false} />}
>
Nested / Bar
Link to 404
</Link>
</li>
</ul>
Expand Down
12 changes: 4 additions & 8 deletions examples/43_weave-render/src/components/FooLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ import type { ReactNode } from 'react';

const FooLayout = ({ children }: { children: ReactNode }) => {
return (
<html>
<body>
<div>
<h1>FOO layout</h1>
{children}
</div>
</body>
</html>
<div>
<h1>FOO layout</h1>
{children}
</div>
);
};

Expand Down
79 changes: 38 additions & 41 deletions examples/43_weave-render/src/components/HomeLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,44 @@ const getCurrentTime = () => new Date();
const HomeLayout = ({ children }: { children: ReactNode }) => {
const currentTime = getCurrentTime();
return (
<html>
<head>
<title>Waku</title>
</head>
<body>
<div>
<h1>Home layout</h1>
<p>Last render time: {currentTime.toISOString()}</p>
<ul>
<li>
<Link
to="/"
pending={<Pending isPending />}
notPending={<Pending isPending={false} />}
>
Home
</Link>
</li>
<li>
<Link
to="/foo"
pending={<Pending isPending />}
notPending={<Pending isPending={false} />}
>
Foo
</Link>
</li>
<li>
<Link
to={'/nested/bar' as never}
pending={<Pending isPending />}
notPending={<Pending isPending={false} />}
>
Nested / Bar
</Link>
</li>
</ul>
{children}
</div>
</body>
</html>
<>
<title>Waku</title>

<div>
<h1>Home layout</h1>
<p>Last render time: {currentTime.toISOString()}</p>
<ul>
<li>
<Link
to="/"
pending={<Pending isPending />}
notPending={<Pending isPending={false} />}
>
Home
</Link>
</li>
<li>
<Link
to="/foo"
pending={<Pending isPending />}
notPending={<Pending isPending={false} />}
>
Foo
</Link>
</li>
<li>
<Link
to="/bar"
pending={<Pending isPending />}
notPending={<Pending isPending={false} />}
>
Bar
</Link>
</li>
</ul>
{children}
</div>
</>
);
};

Expand Down
2 changes: 1 addition & 1 deletion examples/43_weave-render/src/entries.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPages } from 'waku';
import { new_createPages as createPages } from 'waku/router/server';
import type { PathsForPages } from 'waku/router';
import FooPage from './components/FooPage';
import BarPage from './components/BarPage';
Expand Down
2 changes: 1 addition & 1 deletion examples/43_weave-render/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StrictMode } from 'react';
import { createRoot, hydrateRoot } from 'react-dom/client';
import { Router } from 'waku/router/client';
import { NewRouter as Router } from 'waku/router/client';

const rootElement = (
<StrictMode>
Expand Down
Loading