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

reflective-bind

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reflective-bind - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

10

babel/index.js

@@ -379,2 +379,3 @@ /**

!isNonComputedNestedProperty(identifierPath) &&
!isNonComputedObjectKey(identifierPath) &&
!hasBindingInScope(identifierPath, limitScope)

@@ -394,2 +395,11 @@ );

function isNonComputedObjectKey(identifierPath) {
const parentNode = identifierPath.parentPath.node;
return (
t.isProperty(parentNode) &&
!parentNode.computed &&
parentNode.key === identifierPath.node
);
}
/**

@@ -396,0 +406,0 @@ * Returns true iff the identifier is bound within limitScope.

3

CHANGELOG.md

@@ -7,2 +7,5 @@ # Reflective Bind Change Log

## 0.2.3
* Don't hoist handle non-computed object property identifiers
## 0.2.2

@@ -9,0 +12,0 @@ * Upgrade to babel 7

2

package.json
{
"name": "reflective-bind",
"version": "0.2.2",
"version": "0.2.3",
"description": "Eliminate wasteful re-rendering in React components caused by inline functions",

@@ -5,0 +5,0 @@ "author": "Dounan Shi",

@@ -46,14 +46,13 @@ [![Build Status](https://travis-ci.org/flexport/reflective-bind.svg?branch=master)](https://travis-ci.org/flexport/reflective-bind)

If you’re already using `React.PureComponent` and want to avoid updating all of your components, consider monkey patching `shouldComponentUpdate` 🙊
Alternatively, subclass `React.Component` and override `shouldComponentUpdate`. Then extend your custom component when you want a pure component.
```js
import React from "react";
import * as React from "react";
import {shouldComponentUpdate} from "reflective-bind";
React.PureComponent.prototype.shouldComponentUpdate = function(
nextProps,
nextState
) {
return shouldComponentUpdate(this, nextProps, nextState);
};
export default class CustomPureComponent extends React.Component {
shouldComponentUpdate(nextProps, nextState) {
return shouldComponentUpdate(this, nextProps, nextState);
}
}
```

@@ -60,0 +59,0 @@

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