How do I use types when passing data in state with useNavigate? #2132
Unanswered
TTAWTKRUGMAN
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
-
Is there a way to pass data like this and keep my type safety? I don't want to lose my types/autocomplete in the new page. The backend API is set up in a way thats not easy to just get the data based on the path params so its easier to pass the data in.
const handleNavigate = () => { navigate({ to: "/scheduling/new-route", state: { selectedWorkArea: selectedWorkArea, selectedDay: selectedDay, users: users, }, }); };
Beta Was this translation helpful? Give feedback.
All reactions