4 ms·
This is my first time really reading about them, I'd assumed they'd do some ASPX style interactivity where server components updates on the server and send back
by foota 3y ago
This is my first time really reading about them, I'd assumed they'd do some ASPX style interactivity where server components updates on the server and send back html, it's interesting that they haven't tried to go for something like that, meaning this is a lot more limited in scope in some ways than I'd thought.
- marksomnian 3y agoIf you mean updating the page as the result of a mutation, Server Actions (https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations https://nextjs.org/docs/app/building-your-application/data-f..., still in alpha) can do that - Next can re-render a route and send the newly updated UI as part of the response (this is a Next-specific feature, but I can't see why other frameworks couldn't implement a similar pattern around RSCs).
- foota 3y agoWhich of these examples show that? As far as I can tell the closest is the server form, but that only seems to allow the form submissipn to be handled dynamivally, but doesn't show updating the server rendered component?
- marksomnian 3y agoIt's not explicitly demonstrated, but the Revalidating Data example (https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations#revalidating-data https://nextjs.org/docs/app/building-your-application/data-f...) would do it - calling revalidatePath/revalidateTag from a Server Action will (if the current route matches the path/tag) cause the route to get re-rendered as part of the same round trip.