Loading video...

Video Failed to Load

Go Home

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

lawson's profile picture
lawson1 year ago

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

Gus's profile picture
Gus1 year ago

Client state pattern designers:

Eric's profile picture
Eric1 year ago

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

Alex Sidorenko's profile picture
Alex Sidorenko1 year ago

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.

Josh Kotrous's profile picture
Josh Kotrous1 year ago

Amazing use of server actions. Mint. Approved.

Gopinath's profile picture
Gopinath1 year ago

What video capture do you use ?

Kjetil H's profile picture
Kjetil H1 year ago

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

Raqib Nur's profile picture
Raqib Nur1 year ago

nice, thanks for sharing.

Ikuzwe shema Elie's profile picture
Ikuzwe shema Elie1 year ago

This cannot work in production

Related Videos