how to reload page in NextJS app router
Unanswered
Cairn Terrier posted this in #help-forum
Cairn TerrierOP
Hello everyone, sorry bothering you guys, i want to ask somethiing, is there any method i can use to reload the page in NextJs app router, i have a little struggle with my function, i want to make a delete function for my data, but when i delete my data, the data is still show, until i reloading the page, so Is there a method that can reload the page?
2 Replies
@Cairn Terrier Hello everyone, sorry bothering you guys, i want to ask somethiing, is there any method i can use to reload the page in NextJs app router, i have a little struggle with my function, i want to make a delete function for my data, but when i delete my data, the data is still show, until i reloading the page, so Is there a method that can reload the page?
you could use
router.refresh() to invalidate the router cache or use revalidatePath or revalidateTag with server action