Next.js Discord

Discord Forum

Revalidation after client side navigation

Unanswered
Pyrenean Sheepdog posted this in #help-forum
Open in Discord
Pyrenean SheepdogOP
Hey everyone, I can't find a solution for this. I have a component where I'm checking the filters and updating the searchParams in URL. In the ProjectsPage I have a Link which navigates me back to the same URL without searchParams. I also have attached onClick prop with revalidation of /projects path, but the revalidation doesn't seem to be done. Do you have any idea why? Or is there a better way to do this? Thanks 😊

5 Replies

I tried it this way too, but no progress.

<Button className="hover:text-white" onPress={() => { router.push("/projects"); setTimeout(() => { revalidateProjects(); , 50); }} > <RiCloseFill /> </Button>
Pyrenean SheepdogOP
Maybe some caching issue?
@Pyrenean Sheepdog How would you do that?
idk. I just stopped using searchparams. I never found a way to do that.
However: maybe we find a work around what do you expect your button click shoud do?