Why doesn't navigate() interpolate url params instead of calling generatePath? #11263
Unanswered
alimertcakar
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.
-
Why doesn't react router allow us to just
navigate("users/:id",{id:1})
instead ofnavigate(generatePath("users/:id",{id:1}))
Is this because of seperation of concers, or are there other benefits?
There are too many generatePath calls in our projects and its a little irritating to my eyes but I guess with new data api's we'd this less.
I am just asking to understand the reasoning behind this. Is it wise to do as following?
I couldn't think of a downside of this ^. But if this isn't the default there probably is a reason why it isn't.
Thanks in advance for your feedback
Beta Was this translation helpful? Give feedback.
All reactions