Hacker News new | ask | show | jobs
by rockmeamedee 3521 days ago
The way it would work with your chat example is that Next.js would initially render the chatbox component on the server, then hand it over to the user's browser running the React component. Then the user's browser would subscribe to data updates, and would create/update/destroy components as needed as chat messages come in.

The server only sends rendered components once, then the client handles the re-rendering afterwards.

It's still a javascript client-side SPA, except the initial rendering is done by the server. You don't see a loading screen, google can crawl your page, and users can see an initial page with JS turned off).

I hope that cleared things up a bit.