Waiting for revalidatePath to finish should be impossible but isn't #66267
Replies: 2 comments 1 reply
-
Hi, yes you can get response from server actions but its not suggested to do, cause server actions used to mutate data and revalidate fetched data. use server fetching to get data, use server actions to mutate these data and revalidatePath or revalidateTag. |
Beta Was this translation helpful? Give feedback.
-
I tried this with a button without using the action prop on a form and it didn't work. I'm on next 14.1.1. Maybe it has something to do with async vs sync transitions and the action prop on form elements being associated with possible rerouting. Just guessing. I'm also curious if this is expected and if we can rely on it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey good people! I've been playing around with next caching trying to figure out how to await
revalidatePath
(orrevalidateTag
) and I've managed to do it even though this says "There isn't a way to wait for the event to finish.". This is in a component that has "use client" at the top.So I guess my question is.. why does this await the revalidation but the below doesn't and is there a way to get the response value from this server action?
Beta Was this translation helpful? Give feedback.
All reactions