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: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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