Loading video...
Video Failed to Load
How to revalidate a single item in the list after mutation with Server Actions
70,276 views • 1 year ago •via X (Twitter)
9 Comments

I used useActionState to implement auth today. It's so clean

Client state pattern designers:

Is it the same logic used in the optmisc update, isn’t it?

Nope. The demo is more about optimizing db requests. We don't refetch all items on every mutation, but updating an item is still a blocking action (the user has to wait until the mutation happens before the UI updates). We can add optimistic updates as another layer of optimization here to make sure the update happens on the client immediately, without waiting for a server response. P.S. The fact it can be done, doesn't mean it should be done. Optimizations have complexity costs.

Amazing use of server actions. Mint. Approved.

What video capture do you use ?

Nice one. Do you have a suggestion on how to update multiple items (can be new)? I find it cumbersome with the FormData API

nice, thanks for sharing.

This cannot work in production


