hoist-non-react-statics
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -28,6 +28,7 @@ /** | ||
module.exports = function hoistNonReactStatics(targetComponent, sourceComponent) { | ||
var keys = Object.getOwnPropertyNames(sourceComponent); | ||
for (var i=0; i<keys.length; ++i) { | ||
if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]]) { | ||
targetComponent[keys[i]] = sourceComponent[keys[i]]; | ||
var sourceKeys = Object.getOwnPropertyNames(sourceComponent), | ||
targetKeys = Object.getOwnPropertyNames(targetComponent); | ||
for (var i=0; i<sourceKeys.length; ++i) { | ||
if (!REACT_STATICS[sourceKeys[i]] && !KNOWN_STATICS[sourceKeys[i]] && targetKeys.indexOf(sourceKeys[i]) === -1) { | ||
targetComponent[sourceKeys[i]] = sourceComponent[sourceKeys[i]]; | ||
} | ||
@@ -34,0 +35,0 @@ } |
{ | ||
"name": "hoist-non-react-statics", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Copies non-react specific statics from a child component to a parent component", | ||
@@ -25,3 +25,3 @@ "main": "index.js", | ||
"babel-eslint": "^3.0.1", | ||
"chai": "^2.0.0", | ||
"chai": "^3.0.0", | ||
"coveralls": "^2.11.1", | ||
@@ -32,3 +32,3 @@ "eslint": "^0.21.0", | ||
"pre-commit": "^1.0.7", | ||
"react": "^0.13.3" | ||
"react": "<0.15.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "keywords": [ |
@@ -17,2 +17,10 @@ # hoist-non-react-statics | ||
## Usage | ||
```js | ||
import hoistNonReactStatic from 'hoist-non-react-statics'; | ||
hoistNonReactStatic(targetComponent, sourceComponent); | ||
``` | ||
## Compatible React Versions | ||
@@ -22,3 +30,3 @@ | ||
|--------------------------|-------------------------------| | ||
| 0.13 | >= 1.0.0 | | ||
| 0.13-0.14 | >= 1.0.0 | | ||
@@ -25,0 +33,0 @@ ## License |
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
23744
33
38