File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import UserSelection from '@/components/todo/UserSelection';
44
55export 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
Original file line number Diff line number Diff line change 11import TodoList from '@/components/todo/TodoList' ;
22
33export 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}
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ import TodoPage from './[userId]/page';
33
44export 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}
Original file line number Diff line number Diff line change 11/** @type {import('next').NextConfig } */
22const nextConfig = {
33 reactStrictMode : true ,
4+ turbopack : {
5+ root : __dirname ,
6+ } ,
47} ;
58
69module . exports = nextConfig ;
You can’t perform that action at this time.
0 commit comments