You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wording of warnings related to using client components is currently:
You're importing a component that needs useState. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
I think it would be helpful to align the language more closely to talking about "imports" or "files" rather than "parents" since that's a fairly abstract term that could refer to multiple things.
Non-Goals
No response
Background
I now understand that "its parents" in the warning refers to "the import chain of modules leading to the component being included in the React component tree", but I originally took "its parents" to mean something to do with Next 13's layout/template system, since those are also arranged in a hierarchy. I didn't understand I could simply add "use client" to any component module to mark its contents as client-only, I thought I had to do it in specific places such as in templates or layouts.
Proposal
Happy to submit a PR but wanted to get some feedback on whether I've understood the problem being solved here and any thoughts on how it could be reworded to avoid confusion?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
The wording of warnings related to using client components is currently:
Source
I think it would be helpful to align the language more closely to talking about "imports" or "files" rather than "parents" since that's a fairly abstract term that could refer to multiple things.
Non-Goals
No response
Background
I now understand that "its parents" in the warning refers to "the import chain of modules leading to the component being included in the React component tree", but I originally took "its parents" to mean something to do with Next 13's layout/template system, since those are also arranged in a hierarchy. I didn't understand I could simply add "use client" to any component module to mark its contents as client-only, I thought I had to do it in specific places such as in templates or layouts.
Proposal
Happy to submit a PR but wanted to get some feedback on whether I've understood the problem being solved here and any thoughts on how it could be reworded to avoid confusion?
Beta Was this translation helpful? Give feedback.
All reactions