Need Assistance?

support@tutorialshub.in

Server Actions & Forms

Refreshing UI with revalidatePath & redirect

ADVERTISEMENT
Next.js Free Lesson
5 min read
ADVERTISEMENT

After your Server Action inserts or updates data in the database, call revalidatePath('/posts') so Next.js immediately refreshes the cached data on that page—or call redirect('/posts') to send the user there.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you