From f23f43de943dfbf5c1a1752224ff54118ca5df80 Mon Sep 17 00:00:00 2001 From: Hays Clark Date: Tue, 8 Dec 2020 16:30:36 -0800 Subject: [PATCH] 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"