File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -404,19 +404,17 @@ const myRoute = route({
404404``` tsx
405405import { route , parser } from " react-router-typesafe-routes" ;
406406import { schema } from " react-router-typesafe-routes/standard-schema" ;
407- import { z } from " zod/v4 " ; // Zod v4 implements Standard Schema
407+ import { type } from " arktype " ; // Or any other library supporting Standard Schema
408408
409409const myRoute = route ({
410410 path: " :id" ,
411411 // There is no way to get the type hint from a Standard Schema in runtime, so we need to specify it explicitly.
412412 // For the built-in parser, this is only necessary for strings and dates. It's also type-safe!
413413 // It's needed for omitting wrapping quotes in serialized values.
414- params: { id: schema (z . string () .uuid ( ), parser (" string" )) },
414+ params: { id: schema (type ( " string .uuid" ), parser (" string" )) },
415415});
416416```
417417
418- > ❗Zod doesn't do coercion by default, but you may need it for complex values returned from ` JSON.parse ` (for instance, a date wrapped in an object).
419-
420418</details >
421419
422420### Use Zod
You can’t perform that action at this time.
0 commit comments