Next.js Discord

Discord Forum

Data not updating on router actions

Unanswered
Audubon's Oriole posted this in #help-forum
Open in Discord
Audubon's OrioleOP
I have list of stocks on homepage. When I click on any stocks its taking user's to its details page. Details page data are dynamic and changes every seconds. Problem is when i redirect to stock details page its showing me stale data rather than showing me fresh when as I have used export const dynamic = 'force-dynamic'
#next14 #nextjs-showcase #next/navigation

7 Replies

Audubon's OrioleOP
@Ray please suggest solution
@Audubon's Oriole <@743561772069421169> please suggest solution
1. use client side fetching
2. create a client component and call router.refresh() inside a useEffect when mount
Audubon's OrioleOP
okay let me try this
will it update data on browser navigations?
but keep in mind router.refresh() will refetch all data for the page
Audubon's OrioleOP
yepp noted!!