Skip to content

Commit eb26127

Browse files
committed
Externalize React helpers.
React’s official policy on these helpers is “use at your own risk”: - facebook/react#1906 (comment) - facebook/react#2251 (comment) - facebook/react#2317
1 parent 4b114f4 commit eb26127

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
],
2525
"dependencies": {
2626
"core-js": "^0.9.18",
27-
"he": "^0.5.0"
27+
"exenv": "^1.2.0",
28+
"he": "^0.5.0",
29+
"invariant": "^2.1.0",
30+
"shallowequal": "^0.2.1"
2831
},
2932
"peerDependencies": {
3033
"react": "^0.13.x"

src/CreateSideEffect.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
2-
import invariant from "react/lib/invariant";
3-
import shallowEqual from "react/lib/shallowEqual";
2+
import invariant from "invariant";
3+
import shallowequal from "shallowequal";
44

55
const RESERVED_PROPS = {
66
arguments: true,
@@ -33,7 +33,7 @@ export default (Component) => {
3333
}
3434

3535
shouldComponentUpdate(nextProps) {
36-
return !shallowEqual(nextProps, this.props);
36+
return !shallowequal(nextProps, this.props);
3737
}
3838

3939
componentDidUpdate() {

src/Helmet.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import ExecutionEnvironment from "react/lib/ExecutionEnvironment";
2+
import ExecutionEnvironment from "exenv";
33
import CreateSideEffect from "./CreateSideEffect";
44
import {TAG_NAMES, TAG_PROPERTIES} from "./HelmetConstants.js";
55
import HTMLEntities from "he";

0 commit comments

Comments
 (0)