Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hoist-non-react-statics

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hoist-non-react-statics - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

9

index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc