You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using useParams with { strict: false }, we are getting unparsed values back, but they are still typed as if they were parsed.
This is caused by useMatch match.params no longer being parsed (compared to the version we upgraded from) match. _strictParams is parsed, but doesn't contain params from the child routes.
This is the patch we applied to fix the issue for us, it seems a bit blunt though but I hope it helps the team quickly narrow down the issue.
const { version } = useParams({ strict: false });
console.log(version); // in the ide, shows up as number | undefined but in the console, shows up as a string.
Expected behavior
I expect the runtime values of useParams to be equal to their type.
Everywhere that we are casting our ids from strings to numbers using zod (z.coerce.number()) is now working on first render, but on navigate will store the values as strings instead of the correct values. From what I can tell, the most nested match has the correct parsing applied, it's just the parent matches that are storing the param as a string.
Is there a reason that the parent matches need to include the param on their object? I would only expect useParams to reference the most nested match if you use strict: false.
Activity
ViewableGravy commentedon Jan 19, 2026
+1
Everywhere that we are casting our
idsfrom strings to numbers using zod (z.coerce.number()) is now working on first render, but on navigate will store the values as strings instead of the correct values. From what I can tell, the most nested match has the correct parsing applied, it's just the parent matches that are storing the param as a string.Is there a reason that the parent matches need to include the param on their object? I would only expect useParams to reference the most nested match if you use strict: false.