react-router 6.12.0-pre.1 → 6.12.1-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.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # `react-router`
2
2
 
3
- ## 6.12.0-pre.1
3
+ ## 6.12.1-pre.0
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - [internal] use concurrent mode state ([#10553](https://github.com/remix-run/react-router/pull/10553))
7
+ - Adjust feature detection of `React.startTransition` to fix webpack + react 17 compilation error ([#10569](https://github.com/remix-run/react-router/pull/10569))
8
8
 
9
- ## 6.12.0-pre.0
9
+ ## 6.12.0
10
10
 
11
11
  ### Minor Changes
12
12
 
@@ -15,7 +15,7 @@
15
15
  ### Patch Changes
16
16
 
17
17
  - Updated dependencies:
18
- - `@remix-run/router@1.6.3-pre.0`
18
+ - `@remix-run/router@1.6.3`
19
19
 
20
20
  ## 6.11.2
21
21
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v6.12.0-pre.1
2
+ * React Router v6.12.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -821,6 +821,11 @@ function warningOnce(key, cond, message) {
821
821
  }
822
822
  }
823
823
 
824
+ // Webpack + React 17 fails to compile on the usage of `React.startTransition` or
825
+ // `React["startTransition"]` even if it's behind a feature detection of
826
+ // `"startTransition" in React`. Moving this to a constant avoids the issue :/
827
+ const START_TRANSITION = "startTransition";
828
+
824
829
  /**
825
830
  * Given a Remix Router instance, render the appropriate UI
826
831
  */
@@ -833,7 +838,7 @@ function RouterProvider(_ref) {
833
838
  // pick up on any render-driven redirects/navigations (useEffect/<Navigate>)
834
839
  let [state, setStateImpl] = React.useState(router.state);
835
840
  let setState = React.useCallback(newState => {
836
- "startTransition" in React ? React.startTransition(() => setStateImpl(newState)) : setStateImpl(newState);
841
+ START_TRANSITION in React ? React[START_TRANSITION](() => setStateImpl(newState)) : setStateImpl(newState);
837
842
  }, [setStateImpl]);
838
843
  React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);
839
844
  let navigator = React.useMemo(() => {
@@ -913,7 +918,7 @@ function MemoryRouter(_ref3) {
913
918
  location: history.location
914
919
  });
915
920
  let setState = React.useCallback(newState => {
916
- "startTransition" in React ? React.startTransition(() => setStateImpl(newState)) : setStateImpl(newState);
921
+ START_TRANSITION in React ? React[START_TRANSITION](() => setStateImpl(newState)) : setStateImpl(newState);
917
922
  }, [setStateImpl]);
918
923
  React.useLayoutEffect(() => history.listen(setState), [history, setState]);
919
924
  return /*#__PURE__*/React.createElement(Router, {