Simple Example Using Navigate And Search Params
Given a validateSearch object like this:
How should I call
navigate?
Calling navigate like so:
gives an errors saying: Type '{ shouldRedirect: false; }' is not assignable to type 'SearchReducer...
Following the Code Sandbox more closely, I try this:
I get an error saying:
Type 'undefined' is not assignable to type '() => { shape: { stopRedirect: ZodOptional<ZodBoolean>; }; keys: string[]; }'.3 Replies
quickest-silverOP•3y ago
Is it possible because I'm navigating from one route to another? The navigate call is not from a child route
quickest-silver•3y ago
Currently, when validating the query params with zod, you need to call the parse method on the ZodObject passing into it the search params from the router.
quickest-silverOP•3y ago
Makes sense, thank you Sean