use-query-params icon indicating copy to clipboard operation
use-query-params copied to clipboard

Is there a way to get automatic types when configuring global params?

Open bruce-c-liu opened this issue 6 months ago • 0 comments

For example, I have the following:

<QueryParamProvider
  adapter={ReactRouter6Adapter}
  options={{
    params: {
      page: PAGE_SEARCH_PARAM_TYPE,
    },
    removeDefaultsFromUrl: true,
  }}
>

Is there an automatic way to get Typescript types for page and setPage when I do:

const [page, setPage] = useQueryParam("page");

page and setPage are unknown right now.

bruce-c-liu avatar Aug 15 '24 18:08 bruce-c-liu