#validateSearch does not correctly type the Route.useSearch() hook

8 messages · Page 1 of 1 (latest)

strong prairie
#

I must be doing something wrong because when I use the most basic form of validation with validateSearch and Zod, I still get any type when I try to use Route.useSearch()

trail spindle
#

Try validateSearch: searchSchema

strong prairie
tropic plinth
#

@strong prairie also the path "/_app/_start" seems weird to me, because I guess it is the index page of your app? Did you try that on regular route first like src/routes/index.tsx just to test?

strong prairie
#

@tropic plinth The dev server is running.
I don't have any global middlewares.
I'm not using esling, I'm using biome.
tsc --noEmit doesn't return anything which means I don't have typescript errors

I also tested it with a normal route without pathless layouts placed directly under /src/routes

tropic plinth
onyx shore
#

i am having the exact same problem