Can we intercept navigations on a global or per-route basis to add viewTransitions/state? #10766
Unanswered
tarungunampalli1
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently using client side routing with a Data Router. I want to start making use of viewTransitions, but adding a viewTransition prop to every navigate, Navigate, Link, and NavLink is very annoying and not super feasible. Similarly, I would like some global state on our navigations (like a
fromstate that specifies the previous path)My first instinct is to make wrapper functions/components of each that provide the default behavior that I want, but that's annoying to maintain and I would prefer the direct API.
My second thought was using middleware to intercept navigations and apply the state and props, but it doesn't seem like we are allowed to change the navigation from middleware.
Are there any more recommended ways to implement this?
Beta Was this translation helpful? Give feedback.
All reactions