@@ -310,7 +310,7 @@ interface LinkProps extends TouchableHighlightProps {
310
310
children? : React .ReactNode ;
311
311
onPress? (event : GestureResponderEvent ): void ;
312
312
replace? : boolean ;
313
- state? : State ;
313
+ state? : any ;
314
314
to: To ;
315
315
}
316
316
```
@@ -475,7 +475,7 @@ declare function Navigate(props: NavigateProps): null;
475
475
interface NavigateProps {
476
476
to: To ;
477
477
replace? : boolean ;
478
- state? : State ;
478
+ state? : any ;
479
479
}
480
480
```
481
481
@@ -831,7 +831,7 @@ The term "location" in React Router refers to [the `Location` interface](https:/
831
831
>
832
832
> The ` history ` package is React Router's only dependency and many of the
833
833
> core types in React Router come directly from that library including
834
- > ` Location ` , ` To ` , ` Path ` , ` State ` , and others. You can read more about
834
+ > ` Location ` , ` To ` , ` Path ` , and others. You can read more about
835
835
> the history library in [ its documentation] ( https://github.com/remix-run/history/tree/main/docs ) .
836
836
837
837
### ` matchRoutes `
@@ -957,15 +957,12 @@ The `useHref` hook returns a URL that may be used to link to the given `to` loca
957
957
<summary >Type declaration</summary >
958
958
959
959
``` tsx
960
- declare function useLinkClickHandler<
961
- E extends Element = HTMLAnchorElement ,
962
- S extends State = State
963
- >(
960
+ declare function useLinkClickHandler<E extends Element = HTMLAnchorElement >(
964
961
to : To ,
965
962
options ? : {
966
963
target? : React .HTMLAttributeAnchorTarget ;
967
964
replace? : boolean ;
968
- state? : S ;
965
+ state? : any ;
969
966
}
970
967
): (event : React .MouseEvent <E , MouseEvent >) => void ;
971
968
```
@@ -1025,13 +1022,11 @@ const Link = React.forwardRef(
1025
1022
<summary >Type declaration</summary >
1026
1023
1027
1024
``` tsx
1028
- declare function useLinkPressHandler<
1029
- S extends State = State
1030
- >(
1025
+ declare function useLinkPressHandler(
1031
1026
to : To ,
1032
1027
options ? : {
1033
1028
replace? : boolean ;
1034
- state? : S ;
1029
+ state? : any ;
1035
1030
}
1036
1031
): (event : GestureResponderEvent ) => void ;
1037
1032
```
@@ -1091,9 +1086,8 @@ The `useInRouterContext` hooks returns `true` if the component is being rendered
1091
1086
``` tsx
1092
1087
declare function useLocation(): Location ;
1093
1088
1094
- interface Location <S extends State = object | null >
1095
- extends Path {
1096
- state: S ;
1089
+ interface Location extends Path {
1090
+ state: unknown ;
1097
1091
key: Key ;
1098
1092
}
1099
1093
```
@@ -1315,7 +1309,7 @@ function App() {
1315
1309
``` tsx
1316
1310
declare function useSearchParams(
1317
1311
defaultInit ? : URLSearchParamsInit
1318
- ): [URLSearchParams , URLSearchParamsSetter ];
1312
+ ): [URLSearchParams , SetURLSearchParams ];
1319
1313
1320
1314
type ParamKeyValuePair = [string , string ];
1321
1315
@@ -1325,12 +1319,10 @@ type URLSearchParamsInit =
1325
1319
| Record <string , string | string []>
1326
1320
| URLSearchParams ;
1327
1321
1328
- interface URLSearchParamsSetter {
1329
- (
1330
- nextInit : URLSearchParamsInit ,
1331
- navigateOptions ? : { replace? : boolean ; state? : State }
1332
- ): void ;
1333
- }
1322
+ type SetURLSearchParams = (
1323
+ nextInit ? : URLSearchParamsInit ,
1324
+ navigateOpts ? : : { replace? : boolean ; state? : any }
1325
+ ) => void ;
1334
1326
```
1335
1327
1336
1328
</details >
@@ -1381,7 +1373,7 @@ function App() {
1381
1373
``` tsx
1382
1374
declare function useSearchParams(
1383
1375
defaultInit ? : URLSearchParamsInit
1384
- ): [URLSearchParams , URLSearchParamsSetter ];
1376
+ ): [URLSearchParams , SetURLSearchParams ];
1385
1377
1386
1378
type ParamKeyValuePair = [string , string ];
1387
1379
@@ -1391,11 +1383,14 @@ type URLSearchParamsInit =
1391
1383
| Record <string , string | string []>
1392
1384
| URLSearchParams ;
1393
1385
1394
- interface URLSearchParamsSetter {
1395
- (
1396
- nextInit : URLSearchParamsInit ,
1397
- navigateOptions ? : { replace? : boolean ; state? : State }
1398
- ): void ;
1386
+ type SetURLSearchParams = (
1387
+ nextInit ? : URLSearchParamsInit ,
1388
+ navigateOpts ? : : NavigateOptions
1389
+ ) => void ;
1390
+
1391
+ interface NavigateOptions {
1392
+ replace? : boolean ;
1393
+ state? : any ;
1399
1394
}
1400
1395
```
1401
1396
0 commit comments