Hooks in shared component (useParams, useSearch)
Has anyone found a good solution for using type-safe hooks (
The basic problem is something like this:
(Basically a component where the search params or path params are actually present in multiple routes, but just how do you get that in a type-safe way, i.e. without
useParams, useSearch) from components that could be mounted on multiple routes? I'm thinking of writing custom hooks that take an array of from instead of a single from string, but I'd love to know if someone has something better.The basic problem is something like this:
(Basically a component where the search params or path params are actually present in multiple routes, but just how do you get that in a type-safe way, i.e. without
strict:false)