Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> In order for this to work, we'd need to be able to give React a chunk of code that it runs exclusively on the server, to do the database query

This is not true/it’s misleading. What you need is to be able to fetch on the server, and hydrate on the client using data from the server. This is possible with SSR and injecting into the React stream, using isomorphic (client) components.

The article is great, but the reasons for RSC are more subtle/complicated than the flow of the article would imply.



You can see a live demo of this here (using Remix and https://github.com/brillout/react-streaming): https://blessed-ibis-783.convex.site/

The relevant isomorphic data fetching hook source code is here: https://github.com/xixixao/convex-hosting/blob/main/app/hook...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: