Open simonguo opened 1 month ago
Hello, to make this code work, you have to convert the component where your injecting the children to client component. for example, you have to make the App.tsx a client component so that List.tsx will also be automatically converted to client component and be aware of what children looks like(type etc.) You can wrap the code in App.tsx to another wrapper component (with "use client" defined) so that not all of your App becomes client component.
Link to the code that reproduces this issue
https://stackblitz.com/edit/stackblitz-starters-26sp4h
To Reproduce
Current vs. Expected behavior
The Item and List in the above reproduction example may be components of material-ui or rsuite. These components declare
use client
in the file when exporting. As a result, when using server-side component rendering in Nextjs, the type of the component is an anonymous function, and the type of the component cannot be determined by type.Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), Other (Deployed)
Additional context
No response