Skip to content

Commit fe661c5

Browse files
committed
Merge branch 'release-next'
2 parents 610ce6e + 77d7182 commit fe661c5

File tree

10 files changed

+56
-17
lines changed

10 files changed

+56
-17
lines changed

packages/react-router-dom-v5-compat/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# `react-router-dom-v5-compat`
22

3+
## 6.12.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
9+
10+
311
## 6.12.0
412

513
### Patch Changes

packages/react-router-dom-v5-compat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-dom-v5-compat",
3-
"version": "6.12.0",
3+
"version": "6.12.1",
44
"description": "Migration path to React Router v6 from v4/5",
55
"keywords": [
66
"react",
@@ -24,7 +24,7 @@
2424
"types": "./dist/index.d.ts",
2525
"dependencies": {
2626
"history": "^5.3.0",
27-
"react-router": "6.12.0"
27+
"react-router": "6.12.1"
2828
},
2929
"peerDependencies": {
3030
"react": ">=16.8",

packages/react-router-dom/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# `react-router-dom`
22

3+
## 6.12.1
4+
5+
### Patch Changes
6+
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+
- Updated dependencies:
9+
10+
311
## 6.12.0
412

513
### Minor Changes

packages/react-router-dom/index.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ export interface BrowserRouterProps {
300300
window?: Window;
301301
}
302302

303+
// Webpack + React 17 fails to compile on the usage of `React.startTransition` or
304+
// `React["startTransition"]` even if it's behind a feature detection of
305+
// `"startTransition" in React`. Moving this to a constant avoids the issue :/
306+
const START_TRANSITION = "startTransition";
307+
303308
/**
304309
* A `<Router>` for use in web browsers. Provides the cleanest URLs.
305310
*/
@@ -320,8 +325,8 @@ export function BrowserRouter({
320325
});
321326
let setState = React.useCallback(
322327
(newState: { action: NavigationType; location: Location }) => {
323-
"startTransition" in React
324-
? React.startTransition(() => setStateImpl(newState))
328+
START_TRANSITION in React
329+
? React[START_TRANSITION](() => setStateImpl(newState))
325330
: setStateImpl(newState);
326331
},
327332
[setStateImpl]
@@ -363,8 +368,8 @@ export function HashRouter({ basename, children, window }: HashRouterProps) {
363368
});
364369
let setState = React.useCallback(
365370
(newState: { action: NavigationType; location: Location }) => {
366-
"startTransition" in React
367-
? React.startTransition(() => setStateImpl(newState))
371+
START_TRANSITION in React
372+
? React[START_TRANSITION](() => setStateImpl(newState))
368373
: setStateImpl(newState);
369374
},
370375
[setStateImpl]
@@ -402,8 +407,8 @@ function HistoryRouter({ basename, children, history }: HistoryRouterProps) {
402407
});
403408
let setState = React.useCallback(
404409
(newState: { action: NavigationType; location: Location }) => {
405-
"startTransition" in React
406-
? React.startTransition(() => setStateImpl(newState))
410+
START_TRANSITION in React
411+
? React[START_TRANSITION](() => setStateImpl(newState))
407412
: setStateImpl(newState);
408413
},
409414
[setStateImpl]

packages/react-router-dom/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-dom",
3-
"version": "6.12.0",
3+
"version": "6.12.1",
44
"description": "Declarative routing for React web applications",
55
"keywords": [
66
"react",
@@ -24,7 +24,7 @@
2424
"types": "./dist/index.d.ts",
2525
"dependencies": {
2626
"@remix-run/router": "1.6.3",
27-
"react-router": "6.12.0"
27+
"react-router": "6.12.1"
2828
},
2929
"devDependencies": {
3030
"react": "^18.2.0",

packages/react-router-native/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# `react-router-native`
22

3+
## 6.12.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
9+
310
## 6.12.0
411

512
### Patch Changes

packages/react-router-native/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-native",
3-
"version": "6.12.0",
3+
"version": "6.12.1",
44
"description": "Declarative routing for React Native applications",
55
"keywords": [
66
"react",
@@ -22,7 +22,7 @@
2222
"types": "./dist/index.d.ts",
2323
"dependencies": {
2424
"@ungap/url-search-params": "^0.1.4",
25-
"react-router": "6.12.0"
25+
"react-router": "6.12.1"
2626
},
2727
"devDependencies": {
2828
"react": "^18.2.0",

packages/react-router/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# `react-router`
22

3+
## 6.12.1
4+
5+
### Patch Changes
6+
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+
39
## 6.12.0
410

511
### Minor Changes

packages/react-router/lib/components.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ export interface RouterProviderProps {
5454
router: RemixRouter;
5555
}
5656

57+
// Webpack + React 17 fails to compile on the usage of `React.startTransition` or
58+
// `React["startTransition"]` even if it's behind a feature detection of
59+
// `"startTransition" in React`. Moving this to a constant avoids the issue :/
60+
const START_TRANSITION = "startTransition";
61+
5762
/**
5863
* Given a Remix Router instance, render the appropriate UI
5964
*/
@@ -66,8 +71,8 @@ export function RouterProvider({
6671
let [state, setStateImpl] = React.useState(router.state);
6772
let setState = React.useCallback(
6873
(newState: RouterState) => {
69-
"startTransition" in React
70-
? React.startTransition(() => setStateImpl(newState))
74+
START_TRANSITION in React
75+
? React[START_TRANSITION](() => setStateImpl(newState))
7176
: setStateImpl(newState);
7277
},
7378
[setStateImpl]
@@ -178,8 +183,8 @@ export function MemoryRouter({
178183
});
179184
let setState = React.useCallback(
180185
(newState: { action: NavigationType; location: Location }) => {
181-
"startTransition" in React
182-
? React.startTransition(() => setStateImpl(newState))
186+
START_TRANSITION in React
187+
? React[START_TRANSITION](() => setStateImpl(newState))
183188
: setStateImpl(newState);
184189
},
185190
[setStateImpl]

packages/react-router/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router",
3-
"version": "6.12.0",
3+
"version": "6.12.1",
44
"description": "Declarative routing for React",
55
"keywords": [
66
"react",

0 commit comments

Comments
 (0)