Skip to content

Commit dcfc79e

Browse files
committed
Use create-react-context for BC
1 parent f0328c3 commit dcfc79e

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React from "react";
2+
import createReactContext from "create-react-context";
23

3-
const RouterContext = React.createContext({});
4+
const RouterContext = React.createContext
5+
? React.createContext({})
6+
: createReactContext({});
47

58
export default RouterContext;

packages/react-router/package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-router/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"react": ">=15"
3939
},
4040
"dependencies": {
41+
"create-react-context": "^0.1.6",
4142
"history": "^4.7.2",
4243
"hoist-non-react-statics": "^2.5.0",
4344
"invariant": "^2.2.4",

0 commit comments

Comments
 (0)