TanStackT
TanStack2mo ago
8 replies
skinny-azure

Is zodValidator still used for search params?

The docs mention that an adapter is provided for Zod search param validation

https://tanstack.com/router/latest/docs/framework/react/guide/search-params#zod

However, passing in my Zod schema directly to validateSearch seems to work just fine without any discernable type issues. Maybe my example is too simple?

validateSearch: z.object({
    mode: zodValidator(z.enum(["login", "sign-up"]).catch("login").default("login")),
  }),


In any case, the following import also does not seem valid

import { zodValidator } from '@tanstack/zod-adapter'
Similar to how TanStack Query made handling server-state in your React and Solid applications a breeze, TanStack Router aims to unlock the power of URL search params in your applications. 🧠 If you ar...
Was this page helpful?