
@mattpocockuk If you have no context to start with, how would you recommend building it up?
English
Benjamin Reid
33.9K posts

@benjaminreid
Principal Frontend Engineer at @JourneyHosp. Previously made cool things for @simpleweb, @aardman and @adrenalinebuzz.






















Problem: React Router’s useSearchParams is clunky, and not type safe. Values are always returned as strings, and there’s no type-safe protection for writing values. Two solutions: 1. Wrap React Router’s searchParams in a custom hook that validates params via Zod. 2. Consider Tanstack Router instead. It has a strongly typed search params API with built-in validation support. How I do 1: