Skip to content

Commit eb5fb74

Browse files
committed
Support React v18.
1 parent 2ef230f commit eb5fb74

6 files changed

Lines changed: 16 additions & 14 deletions

CacheContext.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { strictEqual } from "assert";
44
import React from "react";
5-
import ReactDOMServer from "react-dom/server.js";
5+
import ReactDOMServer from "react-dom/server";
66

77
import Cache from "./Cache.mjs";
88
import CacheContext from "./CacheContext.mjs";

HydrationTimeStampContext.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { strictEqual } from "assert";
44
import React from "react";
5-
import ReactDOMServer from "react-dom/server.js";
5+
import ReactDOMServer from "react-dom/server";
66

77
import HydrationTimeStampContext from "./HydrationTimeStampContext.mjs";
88
import assertBundleSize from "./test/assertBundleSize.mjs";

LoadingContext.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { strictEqual } from "assert";
44
import React from "react";
5-
import ReactDOMServer from "react-dom/server.js";
5+
import ReactDOMServer from "react-dom/server";
66

77
import Loading from "./Loading.mjs";
88
import LoadingContext from "./LoadingContext.mjs";

changelog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
### Patch
1010

11-
- Updated dev dependencies.
11+
- Updated the [`react`](https://npm.im/react) and [`react-dom`](https://npm.im/react-dom) peer dependencies to `16.14 - 18`.
12+
- Updated dependencies.
1213
- Removed the [`@testing-library/react-hooks`](https://npm.im/@testing-library/react-hooks) dev dependency and rewrote React hook tests using [`react-test-renderer`](https://npm.im/react-test-renderer), a new test utility function `createReactTestRenderer`, and a custom React component `ReactHookTest`.
1314
- Removed the [`fetch-blob`](https://npm.im/fetch-blob) and [`formdata-node`](https://npm.im/formdata-node) dev dependencies. Instead, `File` and `FormData` are imported from [`node-fetch`](https://npm.im/node-fetch).
1415
- Updated `jsconfig.json`:
@@ -17,6 +18,7 @@
1718
- Updated GitHub Actions CI config:
1819
- Run tests with Node.js v14, v16, v18.
1920
- Removed the now redundant `not IE > 0` from the Browserslist query.
21+
- Updated `react-dom/server` imports in tests to suit React v18.
2022
- Fixed the `fetchGraphQL` test with the global `fetch` API unavailable for new versions of Node.js that have the `fetch` global.
2123
- Fixed some JSDoc links.
2224

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,18 @@
9898
},
9999
"browserslist": "Node 14.17 - 15 and Node < 15, Node 16 - 17 and Node < 17, Node >= 18, > 0.5%, not OperaMini all, not dead",
100100
"peerDependencies": {
101-
"react": "16.14 - 17",
102-
"react-dom": "16.14 - 17"
101+
"react": "16.14 - 18",
102+
"react-dom": "16.14 - 18"
103103
},
104104
"dependencies": {
105105
"extract-files": "^12.0.0",
106-
"react-waterfall-render": "^4.0.0"
106+
"react-waterfall-render": "^4.0.1"
107107
},
108108
"devDependencies": {
109109
"@types/node": "^18.6.3",
110-
"@types/react": "^17.0.48",
111-
"@types/react-dom": "^17.0.17",
112-
"@types/react-test-renderer": "^17.0.2",
110+
"@types/react": "^18.0.15",
111+
"@types/react-dom": "^18.0.6",
112+
"@types/react-test-renderer": "^18.0.0",
113113
"abort-controller": "^3.0.0",
114114
"coverage-node": "^6.1.0",
115115
"esbuild": "^0.14.53",
@@ -121,9 +121,9 @@
121121
"gzip-size": "^7.0.0",
122122
"node-fetch": "^3.2.10",
123123
"prettier": "^2.7.1",
124-
"react": "^17.0.2",
125-
"react-dom": "^17.0.2",
126-
"react-test-renderer": "^17.0.2",
124+
"react": "^18.2.0",
125+
"react-dom": "^18.2.0",
126+
"react-test-renderer": "^18.2.0",
127127
"revertable-globals": "^3.0.0",
128128
"test-director": "^8.0.2",
129129
"typescript": "^4.7.4"

useWaterfallLoad.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { deepStrictEqual, ok, rejects, strictEqual, throws } from "assert";
44
import React from "react";
5-
import ReactDOMServer from "react-dom/server.js";
5+
import ReactDOMServer from "react-dom/server";
66
import waterfallRender from "react-waterfall-render/waterfallRender.mjs";
77

88
import Cache from "./Cache.mjs";

0 commit comments

Comments
 (0)