I have recently created my first webapp with Next.js and I was using next-intl for offering multiple languages. I implemented it as described on their website which worked just fine. Also I have added localised not-found pages following this tutorial /docs/environments/error-files#not-foundjs . This also worked just fine when testing localy with "npm run dev", however when I try to build the app I get an error from the root layout.tsx file saying " Type error: Binding element 'children' implicitly has an 'any' type.".
My file (app/layout.tsx) looks exactly as the one provided by next-intl but I put it in here aswell just to be sure:
export default function RootLayout({children}) {
return children;
}
What can I do to fix this error? I tried searching in the next-intl documentation and later also looked online, however I could not find any solution that would work. I would appreciate help from anyone who points me in the right direction. Also please excuse me if its someting really simple, I am quite new to this.
I have recently created my first webapp with Next.js and I was using next-intl for offering multiple languages. I implemented it as described on their website which worked just fine. Also I have added localised not-found pages following this tutorial https://next-intl.dev/docs/environments/error-files#not-foundjs . This also worked just fine when testing localy with "npm run dev", however when I try to build the app I get an error from the root layout.tsx file saying " Type error: Binding element 'children' implicitly has an 'any' type.".
My file (app/layout.tsx) looks exactly as the one provided by next-intl but I put it in here aswell just to be sure:
export default function RootLayout({children}) {
return children;
}
What can I do to fix this error? I tried searching in the next-intl documentation and later also looked online, however I could not find any solution that would work. I would appreciate help from anyone who points me in the right direction. Also please excuse me if its someting really simple, I am quite new to this.
Share Improve this question asked Mar 24 at 21:05 Petr PravdaPetr Pravda 11 bronze badge1 Answer
Reset to default 0It looks like you are using typescript so you have to write type for each props For this example this is the code you should write
{children}: {children: React.ReactNode} Here is the type for children
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744228542a4564127.html
评论列表(0条)