Skip to content

Commit e996bc8

Browse files
author
Luca Forstner
committed
.
1 parent c2d6cc7 commit e996bc8

File tree

29 files changed

+194
-22
lines changed

29 files changed

+194
-22
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
export default function Error({ error, reset }: { error: Error; reset: () => void }) {
44
return (
55
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
6-
<h2>Error (/client-component/render-error)</h2>
6+
<h2>Error (/client-component)</h2>
77
<button onClick={() => reset()}>Reset</button>
88
Error: {error.toString()}
99
</div>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import Link from 'next/link';
1+
'use client';
22

33
export default function Layout({ children }: { children: React.ReactNode }) {
44
return (
55
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
6-
<h1>Layout (/client-component/render-error)</h1>
6+
<h1>Layout (/client-component)</h1>
77
{children}
88
</div>
99
);
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default function Loading() {
22
return (
33
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
4-
<h2>Loading (/client-component/render-error)</h2>
4+
<h2>Loading (/client-component)</h2>
55
</div>
66
);
77
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default function NotFound() {
22
return (
33
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
4-
<h2>Not found (/client-component/render-error)</h2>;
4+
<h2>Not found (/client-component)</h2>;
55
</div>
66
);
77
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { ClientErrorDebugTools } from '../../../components/client-error-debug-tools';
1+
'use client';
2+
3+
import { ClientErrorDebugTools } from '../../components/client-error-debug-tools';
24

35
export default function Page() {
46
return (
57
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
6-
<h2>Page (/client-component/render-error)</h2>
8+
<h2>Page (/client-component)</h2>
79
<ClientErrorDebugTools />
810
</div>
911
);

packages/e2e-tests/test-applications/nextjs-app-dir/app/client-component/parameter/[...parameters]/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
export default function Layout({ children }: { children: React.ReactNode }) {
24
return (
35
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default function Loading() {
22
return (
33
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
4-
<h2>Loading (/)</h2>
4+
<h2>Loading (/client-component/parameter/[...parameters])</h2>
55
</div>
66
);
77
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
'use client';
2-
31
import { ClientErrorDebugTools } from '../../../../components/client-error-debug-tools';
42

5-
export default function Page() {
3+
export default function Page({ params }: { params: Record<string, string> }) {
64
return (
75
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
86
<h2>Page (/client-component/[...parameters])</h2>
7+
<p>Params: {JSON.stringify(params['parameters'])}</p>
98
<ClientErrorDebugTools />
109
</div>
1110
);
1211
}
12+
13+
export async function generateStaticParams() {
14+
return [{ parameters: ['foo', 'bar', 'baz'] }];
15+
}

packages/e2e-tests/test-applications/nextjs-app-dir/app/client-component/parameter/[parameter]/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
export default function Layout({ children }: { children: React.ReactNode }) {
24
return (
35
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import { ClientErrorDebugTools } from '../../../../components/client-error-debug-tools';
22

3-
export default function Page() {
3+
export default function Page({ params }: { params: Record<string, string> }) {
44
return (
55
<div style={{ border: '1px solid lightgrey', padding: '12px' }}>
66
<h2>Page (/client-component/[parameter])</h2>
7+
<p>Parameter: {JSON.stringify(params['parameter'])}</p>
78
<ClientErrorDebugTools />
89
</div>
910
);
1011
}
12+
13+
export async function generateStaticParams() {
14+
return [{ parameter: '42' }];
15+
}

0 commit comments

Comments
 (0)