From 5f3a468864a01f36edc422390b0862cacc4a77bb Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Wed, 3 May 2023 16:56:41 -0400 Subject: [PATCH] Export SetURLSearchParams type --- .changeset/set-search-params-type.md | 6 ++++++ packages/react-router-dom/index.tsx | 2 +- packages/react-router-native/index.tsx | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/set-search-params-type.md diff --git a/.changeset/set-search-params-type.md b/.changeset/set-search-params-type.md new file mode 100644 index 0000000000..0b808c64c5 --- /dev/null +++ b/.changeset/set-search-params-type.md @@ -0,0 +1,6 @@ +--- +"react-router-dom": patch +"react-router-native": patch +--- + +Export `SetURLSearchParams` type diff --git a/packages/react-router-dom/index.tsx b/packages/react-router-dom/index.tsx index 7dd37cf655..e835e8ef63 100644 --- a/packages/react-router-dom/index.tsx +++ b/packages/react-router-dom/index.tsx @@ -916,7 +916,7 @@ export function useSearchParams( return [searchParams, setSearchParams]; } -type SetURLSearchParams = ( +export type SetURLSearchParams = ( nextInit?: | URLSearchParamsInit | ((prev: URLSearchParams) => URLSearchParamsInit), diff --git a/packages/react-router-native/index.tsx b/packages/react-router-native/index.tsx index 706539bd7e..c70d2c9f1a 100644 --- a/packages/react-router-native/index.tsx +++ b/packages/react-router-native/index.tsx @@ -323,7 +323,7 @@ export function useSearchParams( return [searchParams, setSearchParams]; } -type SetURLSearchParams = ( +export type SetURLSearchParams = ( nextInit?: | URLSearchParamsInit | ((prev: URLSearchParams) => URLSearchParamsInit),