From c90042956f079e3a284c77d0e20b954d5c3d05e0 Mon Sep 17 00:00:00 2001 From: Hays Clark Date: Fri, 27 Nov 2020 12:52:04 -0800 Subject: [PATCH 1/2] Support React 17 Resolves #429 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7c072bc6..066824a4 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "testURL": "http://localhost" }, "peerDependencies": { - "react": "15.x || 16.x || 16.4.0-alpha.0911da3", - "react-dom": "15.x || 16.x || 16.4.0-alpha.0911da3" + "react": "^15.0.0 || ^16.0.0 || ^17.0.0", + "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0" }, "devDependencies": { "babel-cli": "^6.26.0", From f23f43de943dfbf5c1a1752224ff54118ca5df80 Mon Sep 17 00:00:00 2001 From: Hays Clark Date: Tue, 8 Dec 2020 16:30:36 -0800 Subject: [PATCH 2/2] create-react-context as optional peerDependency create-react-context is only is needed as a polyfill for React 15 and lower; yet, the inclusion of the library blocks React 17 support. As an "optional" peerDependency, all user needs should be fulfilled while maintaining the spirit that the React libraries (and any needed polyfills) are external to the Router library itself. --- package.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 066824a4..bb0948da 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,13 @@ }, "peerDependencies": { "react": "^15.0.0 || ^16.0.0 || ^17.0.0", - "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0" + "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0", + "create-react-context": "^0.3.0" + }, + "peerDependenciesMeta": { + "create-react-context": { + "optional": true + } }, "devDependencies": { "babel-cli": "^6.26.0", @@ -42,6 +48,7 @@ "babel-plugin-transform-react-remove-prop-types": "^0.4.13", "babel-preset-env": "^1.6.1", "babel-preset-react": "^6.24.1", + "create-react-context": "^0.3.0", "eslint": "^4.18.2", "eslint-config-react-app": "^2.1.0", "eslint-plugin-flowtype": "^2.34.1", @@ -80,7 +87,6 @@ "printWidth": 80 }, "dependencies": { - "create-react-context": "0.3.0", "invariant": "^2.2.3", "prop-types": "^15.6.1", "react-lifecycles-compat": "^3.0.4"