Correctly typing params for navigate
from useNavigate
after upgrade from 1.45 to 1.58
#2385
Unanswered
dotintegral
asked this question in
Q&A
Replies: 1 comment 1 reply
-
hi, Did you find anything ? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hey everyone 👋
We have a function in our app called
goBack
. It's main purpose would be to add some search params to the URL, when user goes back (for example, clicking a "back arrow"on a subpage to go back to the main page).We have typed it as follows:
and then we would use it simply:
However, after we upgraded from
1.45.x
to1.58.x
, I get a TypeScript error:Can you please help me to figure out how to correctly type the return value for function, so then I can use that value as the input for
navigate
? 🤔Beta Was this translation helpful? Give feedback.
All reactions