hoist-non-react-statics
Advanced tools
Comparing version 1.0.2 to 1.0.3
13
index.js
@@ -18,6 +18,15 @@ /** | ||
var KNOWN_STATICS = { | ||
name: true, | ||
length: true, | ||
prototype: true, | ||
caller: true, | ||
arguments: true, | ||
arity: true | ||
}; | ||
module.exports = function hoistNonReactStatics(targetComponent, sourceComponent) { | ||
var keys = Object.keys(sourceComponent); | ||
var keys = Object.getOwnPropertyNames(sourceComponent); | ||
for (var i=0; i<keys.length; ++i) { | ||
if (!REACT_STATICS[keys[i]]) { | ||
if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]]) { | ||
targetComponent[keys[i]] = sourceComponent[keys[i]]; | ||
@@ -24,0 +33,0 @@ } |
{ | ||
"name": "hoist-non-react-statics", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Copies non-react specific statics from a child component to a parent component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23457
32