Typescript 6 support #7406
-
|
Does the router support typescript v6? For some reason, the router lost typing. For example search params resolve to any. In the example below const navigate = Route.useNavigate();
navigate({
search: (prev) => {}
});I have defined When I set typescript version to 5.9 it works fine, but doesn't work for the version 6. |
Beta Was this translation helpful? Give feedback.
Answered by
andrikotliar
May 16, 2026
Replies: 1 comment 1 reply
-
|
typescript 6 is supported. can you share a complete reproducer project? |
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
I found the root cause of the problem. It wasn't the router. I used a zod schema to validate query params in routers. The schema was built in the shared package and emitted typescript declarations.
Those declarations caused
Schema.parseto returnanyinstead of the correct type. Because of that all routes had broken type.I replaced
import z form 'zod'toimport { z } from 'zod'and it's fixed the issue.Thank you.