react-router 7.1.1 → 7.1.2-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/development/{chunk-K6AXKMTT.mjs → chunk-UCVHOMP5.mjs} +10 -8
  3. package/dist/development/dom-export.d.mts +3 -3
  4. package/dist/development/dom-export.d.ts +3 -3
  5. package/dist/development/dom-export.js +9 -7
  6. package/dist/development/dom-export.mjs +2 -2
  7. package/dist/{production/fog-of-war-BhhVTjSZ.d.mts → development/fog-of-war-Ckdfl79L.d.ts} +8 -8
  8. package/dist/development/{fog-of-war-DLtn2OLr.d.ts → fog-of-war-ClXvjZ4E.d.mts} +8 -8
  9. package/dist/development/index.d.mts +7 -7
  10. package/dist/development/index.d.ts +7 -7
  11. package/dist/development/index.js +10 -8
  12. package/dist/development/index.mjs +2 -2
  13. package/dist/development/lib/types/route-module.d.mts +1 -1
  14. package/dist/development/lib/types/route-module.d.ts +1 -1
  15. package/dist/development/lib/types/route-module.js +1 -1
  16. package/dist/development/lib/types/route-module.mjs +1 -1
  17. package/dist/development/{route-data-aSUFWnQ6.d.ts → route-data-Cw8htKcF.d.mts} +10 -8
  18. package/dist/{production/route-data-aSUFWnQ6.d.mts → development/route-data-Cw8htKcF.d.ts} +10 -8
  19. package/dist/production/{chunk-CFRHUJMS.mjs → chunk-3FJJQETC.mjs} +10 -8
  20. package/dist/production/dom-export.d.mts +3 -3
  21. package/dist/production/dom-export.d.ts +3 -3
  22. package/dist/production/dom-export.js +9 -7
  23. package/dist/production/dom-export.mjs +2 -2
  24. package/dist/{development/fog-of-war-BhhVTjSZ.d.mts → production/fog-of-war-Ckdfl79L.d.ts} +8 -8
  25. package/dist/production/{fog-of-war-DLtn2OLr.d.ts → fog-of-war-ClXvjZ4E.d.mts} +8 -8
  26. package/dist/production/index.d.mts +7 -7
  27. package/dist/production/index.d.ts +7 -7
  28. package/dist/production/index.js +10 -8
  29. package/dist/production/index.mjs +2 -2
  30. package/dist/production/lib/types/route-module.d.mts +1 -1
  31. package/dist/production/lib/types/route-module.d.ts +1 -1
  32. package/dist/production/lib/types/route-module.js +1 -1
  33. package/dist/production/lib/types/route-module.mjs +1 -1
  34. package/dist/production/{route-data-aSUFWnQ6.d.ts → route-data-Cw8htKcF.d.mts} +10 -8
  35. package/dist/{development/route-data-aSUFWnQ6.d.mts → production/route-data-Cw8htKcF.d.ts} +10 -8
  36. package/package.json +1 -1
@@ -551,11 +551,7 @@ declare class DataWithResponseInit<D> {
551
551
  * @category Utils
552
552
  */
553
553
  declare function data<D>(data: D, init?: number | ResponseInit): DataWithResponseInit<D>;
554
- type RedirectFunction = (url: string, init?: number | ResponseInit) => Redirect;
555
- declare const redirectSymbol: unique symbol;
556
- type Redirect = Response & {
557
- [redirectSymbol]: never;
558
- };
554
+ type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
559
555
  /**
560
556
  * A redirect response. Sets the status code and the `Location` header.
561
557
  * Defaults to "302 Found".
@@ -796,7 +792,7 @@ interface Router {
796
792
  }
797
793
  /**
798
794
  * State maintained internally by the router. During a navigation, all states
799
- * reflect the the "old" location unless otherwise noted.
795
+ * reflect the "old" location unless otherwise noted.
800
796
  */
801
797
  interface RouterState {
802
798
  /**
@@ -1204,11 +1200,17 @@ declare const ViewTransitionContext: React.Context<ViewTransitionContextObject>;
1204
1200
  type FetchersContextObject = Map<string, any>;
1205
1201
  declare const FetchersContext: React.Context<FetchersContextObject>;
1206
1202
  interface NavigateOptions {
1203
+ /** Replace the current entry in the history stack instead of pushing a new one */
1207
1204
  replace?: boolean;
1205
+ /** Adds persistent client side routing state to the next location */
1208
1206
  state?: any;
1207
+ /** If you are using {@link https://api.reactrouter.com/v7/functions/react_router.ScrollRestoration.html <ScrollRestoration>}, prevent the scroll position from being reset to the top of the window when navigating */
1209
1208
  preventScrollReset?: boolean;
1209
+ /** Defines the relative path behavior for the link. "route" will use the route hierarchy so ".." will remove all URL segments of the current route pattern while "path" will use the URL path so ".." will remove one URL segment. */
1210
1210
  relative?: RelativeRoutingType;
1211
+ /** Wraps the initial state update for this navigation in a {@link https://react.dev/reference/react-dom/flushSync ReactDOM.flushSync} call instead of the default {@link https://react.dev/reference/react/startTransition React.startTransition} */
1211
1212
  flushSync?: boolean;
1213
+ /** Enables a {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API View Transition} for this navigation by wrapping the final state update in `document.startViewTransition()`. If you need to apply specific styles for this view transition, you will also need to leverage the {@link https://api.reactrouter.com/v7/functions/react_router.useViewTransitionState.html useViewTransitionState()} hook. */
1212
1214
  viewTransition?: boolean;
1213
1215
  }
1214
1216
  /**
@@ -1541,8 +1543,8 @@ type Serialize<T> = T extends Serializable ? T : T extends (...args: any[]) => u
1541
1543
  } : undefined;
1542
1544
  type VoidToUndefined<T> = Equal<T, void> extends true ? undefined : T;
1543
1545
  type DataFrom<T> = IsAny<T> extends true ? undefined : T extends Func ? VoidToUndefined<Awaited<ReturnType<T>>> : undefined;
1544
- type ClientData<T> = T extends Redirect ? never : T extends DataWithResponseInit<infer U> ? U : T;
1545
- type ServerData<T> = T extends Redirect ? never : T extends DataWithResponseInit<infer U> ? Serialize<U> : Serialize<T>;
1546
+ type ClientData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? U : T;
1547
+ type ServerData<T> = T extends Response ? never : T extends DataWithResponseInit<infer U> ? Serialize<U> : Serialize<T>;
1546
1548
  type ServerDataFrom<T> = ServerData<DataFrom<T>>;
1547
1549
  type ClientDataFrom<T> = ClientData<DataFrom<T>>;
1548
1550
  type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router",
3
- "version": "7.1.1",
3
+ "version": "7.1.2-pre.0",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",