New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pure-stateless

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pure-stateless - npm Package Compare versions

Comparing version 1.0.2 to 1.0.4

6

index.js
var createClass = require('react').createClass
var shallowEqual = require('fbjs/lib/shallowEqual')
var noop = function(){}

@@ -14,2 +15,4 @@ module.exports = function pureStateless(statelessComponent) {

const statelessWillMount = statelessComponent.statelessWillMount || noop
return createClass({

@@ -23,3 +26,4 @@ displayName: statelessComponent.displayName,

componentWillMount: function(){
statelessComponent.statelessWillMount(this)
const result = statelessWillMount(this, this.props, this.context)
result && Object.assign(this, result)
},

@@ -26,0 +30,0 @@ render: function() {

2

package.json
{
"name": "pure-stateless",
"version": "1.0.2",
"version": "1.0.4",
"description": "Pure Stateless React Components",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,9 +13,6 @@ # pure-stateless - Simple and fast React components

const PureStateLessComponent = pureStateless({
statelessWillMount: self => {
// the onClick handler will be created only once
self.onClick = e => {
const {handleClick, index} = self.props
handleClick(index)
}
},
// the onClick handler will be created only once
statelessWillMount: (self, {handleClick, index}) => ({
onClick: e => handleClick(index)
}),
render: (self, {value}) => {

@@ -22,0 +19,0 @@ return (

@@ -8,3 +8,3 @@ import React, {Component} from 'react'

console.log('StateLessComponent creating onClick.')
console.log('StateLessComponent (not the stateless pure one) creating onClick.')
const onClick = e => handleClick(index)

@@ -32,10 +32,6 @@

const PureStateLessComponent = pureStateless({
statelessWillMount: self => {
console.log('PureStateLessComponent creating onClick.')
// the onClick handler will be created only once
self.onClick = e => {
const {handleClick, index} = self.props
handleClick(index)
}
},
// the onClick handler will be created only once
statelessWillMount: (self, {handleClick, index}) => ({
onClick: e => handleClick(index)
}),
render: (self, {value}) => {

@@ -42,0 +38,0 @@ return (

Sorry, the diff of this file is not supported yet

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