Refetch routeData when dynamic route changes
I use a dynamic route
[slug].tsx
to display a blogpost for example. To get the data of the post from the database I use routeData
in combination with createRouteData
. Thereby I set the slug
as the key
. If I now navigate with a link between blogposts, routeData
or createRouteData
is not executed again, so the content of the dynamic route does not change. Is this intended or a bug? Do I need to use refetchRouteData
to trigger this myself e.g. in createEffect
?
1 Reply
Ok, I think figured out how it works. I have changed the key to a function with an array.