Skip to content

Add 'use client' in the correct places #4689

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

Closed
TkDodo opened this issue Dec 23, 2022 · 4 comments
Closed

Add 'use client' in the correct places #4689

TkDodo opened this issue Dec 23, 2022 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers package: react-query

Comments

@TkDodo
Copy link
Collaborator

TkDodo commented Dec 23, 2022

To be compatible with React Server Components

@Ephem we'd need to decide if this can go into v4 or if we also do this for v5

@Ephem
Copy link
Collaborator

Ephem commented Dec 25, 2022

At least on the surface this is an easy fix with no downsides I can see that helps early adopters play with the new APIs without a bunch of wrapping, so I think we should add it in a v4 minor. I haven't investigated the exact places to add it yet though, but that shouldn't be that tricky.

@TkDodo TkDodo added enhancement New feature or request good first issue Good for newcomers labels Dec 25, 2022
@Suman085
Copy link

Suman085 commented Jan 1, 2023

I would be happy to contribute here if I get more clarity on the work that needs to be done here :)

@TkDodo
Copy link
Collaborator Author

TkDodo commented Jan 1, 2023

@Suman085 we'd need to add "use client" at the top of all files that use either state, context or effects in order to have them opt out of being server components in next13.

the devtools would also naturally need "use client".

@abhijithp05
Copy link

Please close this issue

@TkDodo TkDodo closed this as completed Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers package: react-query
Projects
None yet
Development

No branches or pull requests

4 participants