App router question about Link

So, I have two pages. Page A has a <Link href="/b" />, Page B has a Math.random() called during the RSC run through. Page B also has a link back to page A. If I keep navigating between these pages, the Math.random is only ever called once. This is due to the soft navigation in next. How do I prevent or turn this off for a page? export const revalidate = 0 does nothing. I know I could manually do a router.replace then router.refresh, but that's very hacky obviously
4 Replies
techblooded
techblooded15mo ago
File Conventions: Route Segment Config
Learn about how to configure options for Next.js route segments.
techblooded
techblooded15mo ago
I think force-dynamic should get the job done
Web Dev Cody
Web Dev Cody15mo ago
@yashsingh1 it didn't help
techblooded
techblooded15mo ago
o shoot mb so u want to force hard navigation there r two ways to do that, either you can add a dynamic param that is random or you can use server actions and run revalidatePath not sure if there is a better way tho or i guess you can use the a tag
Want results from more Discord servers?
Add your server