Socket
Socket
Sign inDemoInstall

react-measure

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-measure - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

9

dist/index.cjs.js

@@ -152,7 +152,2 @@ 'use strict';

_this._window = getWindowOf(_this._node);
if (_this._resizeObserver !== null && _this._node !== null) {
_this._resizeObserver.observe(_this._node);
}
var innerRef = _this.props.innerRef;

@@ -167,2 +162,6 @@

}
if (_this._resizeObserver !== null && _this._node !== null) {
_this._resizeObserver.observe(_this._node);
}
};

@@ -169,0 +168,0 @@

@@ -146,7 +146,2 @@ import _extends from '@babel/runtime/helpers/esm/extends';

_this._window = getWindowOf(_this._node);
if (_this._resizeObserver !== null && _this._node !== null) {
_this._resizeObserver.observe(_this._node);
}
var innerRef = _this.props.innerRef;

@@ -161,2 +156,6 @@

}
if (_this._resizeObserver !== null && _this._node !== null) {
_this._resizeObserver.observe(_this._node);
}
};

@@ -163,0 +162,0 @@

@@ -1209,7 +1209,2 @@ (function (global, factory) {

_this._window = getWindowOf$1(_this._node);
if (_this._resizeObserver !== null && _this._node !== null) {
_this._resizeObserver.observe(_this._node);
}
var innerRef = _this.props.innerRef;

@@ -1224,2 +1219,6 @@

}
if (_this._resizeObserver !== null && _this._node !== null) {
_this._resizeObserver.observe(_this._node);
}
};

@@ -1226,0 +1225,0 @@

{
"name": "react-measure",
"version": "2.4.0",
"version": "2.5.0",
"description": "Compute measurements of React components.",

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

@@ -92,2 +92,18 @@ import React, { createRef } from 'react'

})
it('should trigger onResize after setting innerRef', () => {
const ref = createRef()
let refOnResize = undefined;
const onResize = () => refOnResize = ref.current
render(
<MeasureWith
onResize={onResize}
innerRef={ref}
children={({ measureRef }) => <div id={'child'} ref={measureRef} />}
/>,
container
)
expect(refOnResize).not.toBe(null)
expect(refOnResize.id).toBe('child')
})
it('should trigger onResize when componentDidMount is called', () => {

@@ -94,0 +110,0 @@ const onResize = jest.fn()

@@ -93,6 +93,2 @@ import { Component, createElement } from 'react'

if (this._resizeObserver !== null && this._node !== null) {
this._resizeObserver.observe(this._node)
}
const { innerRef } = this.props

@@ -106,2 +102,6 @@ if (innerRef) {

}
if (this._resizeObserver !== null && this._node !== null) {
this._resizeObserver.observe(this._node)
}
}

@@ -108,0 +108,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