Multiple data fetches from server action do not resolve 1 by 1 #66031
Unanswered
carvalhomeo
asked this question in
App Router
Replies: 1 comment 1 reply
-
In your example, I would remove |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys,
I have a project to list and add new to-dos by using server actions. I'm using useOptimistic to display a pending state when mutating data but it seems that if multiple requests are triggered at the same time my UI only updates when all requests are finished.
As per Nextjs docs it seems this is in fact the expected behaviour:
"Perform multiple data fetches with single round-trip instead of multiple individual requests on the client."
My question is, how can i make it work such that each request, when finished, updates the UI and doesn't wait for all the request to be finished?
Here is a repo with the project: https://github.com/carvalhomeo/optimistic
Screen_Recording_2024-05-03_at_13.28.25.mov
Beta Was this translation helpful? Give feedback.
All reactions