Replies: 2 comments
-
U found something to mimic this behavior? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This would be nice, I'm also looking for a way to do this, if it's even possible. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Goals
It would be useful if
revalidatePath
andrevalidateTag
from"next/cache"
allowed to wait for the revalidation to complete, returningPromise<void>
instead ofvoid
.Non-Goals
No response
Background
There is no other way that I am aware of to achieve the same result.
Proposal
Example use case using server actions for simplicity, the same concept can be applied to route handlers
This way,
"loading"
class will only be removed after revalidation. The same example withoutrevalidatePath
being a promise, as it is right now, would result in"loading"
class removed, revalidation happening and"inactive"
class applied after revalidation, flashing the"default"
class duringrevalidatePath
call.Beta Was this translation helpful? Give feedback.
All reactions