taxonomy
taxonomy copied to clipboard
'use client' at root
I noticed at the root of the project in app/layout
taxonomy imports the client component ThemeProvider
and passes the rest of the children down through props. I'm new to Next.js but I see in the documentation, that "Once "use client" is defined in a file, all other modules imported into it, including child components, are considered part of the client bundle" Is this a non-issue since the children are only passed by prop?
Perhaps regardless of impact, it's necessary because createContext requires 'use client'.
I don't know the answer, but ThemeProvider is a HOC so I do believe you have a good concern.
As stated, child components are the ones that will be transformed into client components. What you pass in as children
will not be affected. you might want to read this article https://www.developerway.com/posts/react-elements-children-parents
@bryanltobing
Great article, this helps clear up my question. Thank you for sharing!