Using navigate component for render-time decisions #14382
Unanswered
pgsandstrom
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.
-
The docs currently say about the navigate component "It's recommended to avoid using this component in favor of useNavigate." https://reactrouter.com/api/components/Navigate
Im currently develop a quite huge app. Sometimes when we load a route we do quite a bit of calculation to see if this is a view that the user should be viewing. When it is not, we use the navigate component to send them away. Is this a "proper" usage of the navigate component?
Technically we could do all this evaluation where we create the
Routes/Route
stuff. But that contains hundreds of routes, and evaluating which of all these routes that are valid would require downloading much data and doing heavy calculations.Beta Was this translation helpful? Give feedback.
All reactions