admin管理员组

文章数量:1401143

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 badge
Add a comment  | 

1 Answer 1

Reset to default 0

It 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

本文标签: Binding element 39children39 implicitly has an 39any39 typets(7031) in NextjsnextintlStack Overflow