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
helpful-purple•8mo ago
createFileRoute needs the string literal. don't supply a variable
stormy-goldOP•8mo ago
Perfect! Thanks 😉
@Manuel Schiller do you also know how to unset the searchParam isNewUser?
helpful-purple•8mo ago
you need to navigate to remove it
otherwise checkout search middlewares
stormy-goldOP•8mo ago
ah i think like this
Full solution to remove the isNewUser after firing confetti
... its not fully removing the searchParam: "/dashboard?isNewUser="