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

react-height

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-height - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

20

lib/ReactHeight.js

@@ -33,3 +33,4 @@ 'use strict';

componentWillMount: function componentWillMount() {
this.height = -1;
this.height = 0;
this.dirty = true;
},

@@ -39,6 +40,5 @@

this.height = this.refs.wrapper.clientHeight;
if (this.height > -1) {
this.forceUpdate();
return this.props.onHeightReady(this.height);
}
this.dirty = false;
this.forceUpdate();
this.props.onHeightReady(this.height);
},

@@ -50,3 +50,3 @@

if (children !== this.props.children) {
this.height = -1;
this.dirty = true;
}

@@ -59,7 +59,11 @@ },

if (this.refs.wrapper) {
this.dirty = false;
if (this.refs.wrapper.clientHeight !== this.height) {
this.height = this.refs.wrapper.clientHeight;
this.forceUpdate();
this.props.onHeightReady(this.height);
} else {
this.forceUpdate();
}
this.forceUpdate();
}

@@ -76,3 +80,3 @@ },

if (this.height > -1) {
if (!this.dirty) {
return hidden ? null : _react2['default'].createElement(

@@ -79,0 +83,0 @@ 'div',

2

package.json
{
"name": "react-height",
"version": "1.0.1",
"version": "1.0.2",
"description": "Component-wrapper to determine and report children elements height",

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

@@ -19,3 +19,4 @@ import React from 'react';

componentWillMount() {
this.height = -1;
this.height = 0;
this.dirty = true;
},

@@ -26,6 +27,5 @@

this.height = this.refs.wrapper.clientHeight;
if (this.height > -1) {
this.forceUpdate();
return this.props.onHeightReady(this.height);
}
this.dirty = false;
this.forceUpdate();
this.props.onHeightReady(this.height);
},

@@ -36,3 +36,3 @@

if (children !== this.props.children) {
this.height = -1;
this.dirty = true;
}

@@ -47,7 +47,11 @@ },

if (this.refs.wrapper) {
this.dirty = false;
if (this.refs.wrapper.clientHeight !== this.height) {
this.height = this.refs.wrapper.clientHeight;
this.forceUpdate();
this.props.onHeightReady(this.height);
} else {
this.forceUpdate();
}
this.forceUpdate();
}

@@ -60,3 +64,3 @@ },

if (this.height > -1) {
if (!this.dirty) {
return hidden ? null : <div {...props}>{children}</div>;

@@ -63,0 +67,0 @@ }

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