hoist-non-react-statics
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -27,5 +27,13 @@ /** | ||
var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function'; | ||
module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) { | ||
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components | ||
var keys = Object.getOwnPropertyNames(sourceComponent); | ||
/* istanbul ignore else */ | ||
if (isGetOwnPropertySymbolsAvailable) { | ||
keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent)); | ||
} | ||
for (var i = 0; i < keys.length; ++i) { | ||
@@ -32,0 +40,0 @@ if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) { |
{ | ||
"name": "hoist-non-react-statics", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Copies non-react specific statics from a child component to a parent component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,3 @@ # hoist-non-react-statics | ||
|--------------------------|-------------------------------| | ||
| 0.13-0.14 | >= 1.0.0 | | ||
| 0.13-15.0 | >= 1.0.0 | | ||
@@ -32,0 +32,0 @@ ## License |
24131
42