Next.js Discord

Discord Forum

SSR vs CSR

Unanswered
Asian black bear posted this in #help-forum
Open in Discord
Avatar
Asian black bearOP
Hi, I have a table inside a dashboard where I use SSR to display all the content, but you can open a Dialog and add an item via a CSR component. Unfortunately, I have to reload the page to see the changes in the SSR part.

What I tried already:
I've read about revalidateTag() and I've set an API Route to revalidate the tag used in the SSR part, but I still need a refresh.

How can I fix my issue? Is there any best practice for this? Thanks in advance.

2 Replies

Avatar
Asian black bearOP
Should I rather put the whole table into CSR? I like how data is instantly there becuause of SSR...
Avatar
Asian black bearOP
OK I found the solution.

await fetch('/api/revalidate?tag=some-tag') router.refresh()