Skip to content

Commit 93a22bc

Browse files
pkg: Update next to v16 (#3579)
* pkg: Update `next` to v16 * fix: Nextjs 16 upgrade needs --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Nathaniel Tucker <me@ntucker.me>
1 parent 4110ef0 commit 93a22bc

7 files changed

Lines changed: 180 additions & 223 deletions

File tree

examples/nextjs/app/[userId]/layout.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import UserSelection from '@/components/todo/UserSelection';
44

55
export default async function TodoLayout(props: {
66
children: React.ReactNode;
7-
params?: Promise<{ userId: number }>;
7+
params?: Promise<{ userId: string }>;
88
}) {
99
const params = await props.params;
1010
const { children } = props;
@@ -17,7 +17,9 @@ export default async function TodoLayout(props: {
1717
content="NextJS integration with Reactive Data Client"
1818
/>
1919

20-
<UserSelection userId={params?.userId} />
20+
<UserSelection
21+
userId={params?.userId ? Number(params.userId) : undefined}
22+
/>
2123

2224
{children}
2325

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import TodoList from '@/components/todo/TodoList';
22

33
export default async function TodoPage(props: {
4-
params: Promise<{ userId: number }>;
4+
params: Promise<{ userId: string }>;
55
}) {
6-
return <TodoList {...await props.params} />;
6+
const params = await props.params;
7+
return <TodoList userId={Number(params.userId)} />;
78
}

examples/nextjs/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import TodoPage from './[userId]/page';
33

44
export default function Home() {
55
return (
6-
<TodoLayout params={{ userId: 1 }}>
7-
<TodoPage params={{ userId: 1 }} />
6+
<TodoLayout params={Promise.resolve({ userId: '1' })}>
7+
<TodoPage params={Promise.resolve({ userId: '1' })} />
88
</TodoLayout>
99
);
1010
}

examples/nextjs/next.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
33
reactStrictMode: true,
4+
turbopack: {
5+
root: __dirname,
6+
},
47
};
58

69
module.exports = nextConfig;

0 commit comments

Comments
 (0)