Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion web/default/src/components/page-transition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ export function PageTransition(props: PageTransitionProps) {

export function AnimatedOutlet() {
const shouldReduce = useReducedMotion()
// Key the page transition by the matched route id, not the resolved pathname.
// Navigating between params of the same route (e.g. dashboard tabs served by
// /dashboard/$section) then re-renders in place instead of remounting the
// route component and discarding its state (such as the selected time range).
const routeKey = useRouterState({
select: (s) => s.location.pathname,
select: (s) => s.matches.at(-1)?.routeId ?? s.location.pathname,
})

if (shouldReduce) {
Expand Down