Skip to content
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

refactor: clean up useClient #23280

Merged
merged 3 commits into from May 6, 2024
Merged

refactor: clean up useClient #23280

merged 3 commits into from May 6, 2024

Conversation

charislam
Copy link
Contributor

@charislam charislam commented Apr 25, 2024

Move useClients to the actual file instead of index files, so that (a) we don't ship unnecessary client-side code and (b) we don't get the "can't dot into client component from server" error when trying to use MDX in RSCs.

Copy link

supabase bot commented Apr 25, 2024

No changes detected in supabase directory.
This pull request has been ignored for the connected project xguihxuzqibwxjnimxev due to its connection settings.
Go to Project Integrations Settings ↗︎ in order to change this behavior.


Branching Preview Branches by Supabase.
Learn more about Supabase for Git ↗︎.

Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
database-new ✅ Ready (Inspect) Visit Preview May 3, 2024 4:16pm
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 4:16pm
studio-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 4:16pm
zone-www-dot-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 4:16pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
studio ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 4:16pm
studio-self-hosted ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 4:16pm
ui-storybook ⬜️ Ignored (Inspect) May 3, 2024 4:16pm

packages/ui/src/components/Accordion/index.tsx Outdated Show resolved Hide resolved
@MildTomato
Copy link
Contributor

MildTomato commented Apr 26, 2024

This doesn't seem right to me.

Screenshot 2024-04-26 at 12 48 50 PM

why do we need separate import files if we have already removed 'use client' from the index.tsx ?

@charislam
Copy link
Contributor Author

This doesn't seem right to me.

Screenshot 2024-04-26 at 12 48 50 PM why do we need separate import files if we have already removed 'use client' from the index.tsx ?

just tested against the main migration pr and you're right, it works without, gonna change

@@ -1,4 +1,5 @@
import * as React from 'react'
'use client'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is on an index file because it exports an object and I think you will otherwise run into the "cannot dot into a client component" problem

@charislam charislam merged commit 94c906b into master May 6, 2024
14 checks passed
@charislam charislam deleted the refactor/use-client branch May 6, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants