-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove "use client" in favor of client-only #331
Comments
I know this seems pretty old, but what is the thinking behind |
The thinking is that the error message is more useful if someone accidentally imports it in the wrong environment. |
I see. I guess my initial impression was that as someone using the library, it was less convenient than just having 'use client' embedded in the component itself. It could be ignorance on my part, but I'm guessing that even with 'use client' in the component, you could still run into issues? |
Isn't this worse DX? |
Describe the feature / bug 📝:
Right now sonner publishes "use client" in it's source. This should be an application-level concern rather than a library one. For more on this: adobe/react-spectrum#5826
As another motivation, using sonner with vite currently gives this error:
I think following the pattern taken by react-aria (simply using the
client-only
module by Sebastian) is the right approach here:The resulting error message is better and it's less limiting.
The text was updated successfully, but these errors were encountered: