
ALT An illustrated flowchart titled "Typical SPA", representing the communication between a User, Browser, and Server in a Single Page Application. It starts with the user visiting a site, the browser requesting and receiving the document, triggering a loading spinner. Then, it requests and receives the client code. Next, the browser requests data, the server sends back JSON, and the browser updates UI components and the UI with the JSON data. A state change like a route change triggers the browser to render a pending UI, request new data, receive new JSON, and update the UI again. Finally, a user-triggered action, like form submission, prompts the browser to make a POST request, the server performs an action with the post body, sends back JSON, and the browser updates the UI again. Each step is color-coded to show the request and response flow.

ALT A flowchart titled "Super Simple React Server Components/Actions". It depicts interactions between a User, Browser, and Server without optimizations or build tools. The flow starts with a user going to a site, triggering a series of requests and responses between the browser and server, involving documents and JSX payloads. The server-side actions include generating serialized JSX and streaming it to the browser, which renders a UI with fallbacks and hydrates client components. The note indicates only initial page load uses streamed data. The chart further shows state changes, UI updates, and actions like form submissions, using React Server Components methods like 'createFromFetch' and 'startTransition'. The server handles POST requests and streams JSX with action return values back to the browser.

ALT import { getUsers } from 'services/users'; export default async function UsersPage() { // Imagine `getUsers` queries the DB via SQL. // No HTTP call required, because this runs on the server! 🔥 const users = await getUsers(); return ( <ul> {users.map(u => ( <li key={u.id}>{u.name}</li> ))} </ul> ); }

























