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

React Server Components Compatibility #22

Open
jlarmstrongiv opened this issue Apr 2, 2023 · 1 comment
Open

React Server Components Compatibility #22

jlarmstrongiv opened this issue Apr 2, 2023 · 1 comment

Comments

@jlarmstrongiv
Copy link

jlarmstrongiv commented Apr 2, 2023

Server Components are being added to React:

Server Components must avoid Client Component APIs, such as useEffect, etc. Some shared APIs like forwardRef and useId are compatible between both environments.

I like the create-slots package. It fills the gap I missed when working with Vue and Web Components—a slots API.

Can create-slots be updated to work in the Server Components environment, or will that break the rendering you described in the RFC?

Checkout the console.log you will find how clean it will be if it's built in React core, as in user space we have no way to know the index when inserting an item, so I have to rescan the children of a host, then it results in lots of force update

@nihgwu
Copy link
Owner

nihgwu commented Apr 3, 2023

I'm afraid unless it's a builtin feature in React, it's impossible to get rid of useContext and useEffect

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

No branches or pull requests

2 participants