Property 'isNewUser' does not exist on type '{}'** Route.useSearch
I'm using TanStack Router and have defined a search schema with
isNewUser
as an optional string parameter:
However, when I try to access isNewUser
from the search params:
TypeScript gives me the error: "Property 'isNewUser' does not exist on type '{}'"
It seems like the type inference isn't working correctly with the zod schema. How can I fix this type issue?4 Replies
noble-gold•6mo ago
createFileRoute needs the string literal. don't supply a variable
xenial-blackOP•6mo ago
Perfect! Thanks 😉
@Manuel Schiller do you also know how to unset the searchParam isNewUser?
noble-gold•6mo ago
you need to navigate to remove it
otherwise checkout search middlewares
xenial-blackOP•6mo ago
ah i think like this
Full solution to remove the isNewUser after firing confetti
... its not fully removing the searchParam: "/dashboard?isNewUser="