react-measure
Advanced tools
Comparing version 2.2.0 to 2.2.1
## CHANGELOG | ||
### 2.2.1 | ||
Fix `ResizeObserver` callback error | ||
Fix `eslint` warnings | ||
### 2.2.0 | ||
@@ -4,0 +10,0 @@ |
@@ -11,3 +11,2 @@ 'use strict'; | ||
var react = require('react'); | ||
var react__default = _interopDefault(react); | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
@@ -109,4 +108,6 @@ var ResizeObserver = _interopDefault(require('resize-observer-polyfill')); | ||
}; | ||
_this._resizeObserver = new ResizeObserver(_this.measure); | ||
_this._animationFrameID = null; | ||
_this._resizeObserver = new ResizeObserver(function () { | ||
_this.measure(); | ||
}); | ||
@@ -190,3 +191,3 @@ _this.measure = function (entries) { | ||
var Measure = withContentRect()(function Measure(_ref) { | ||
var Measure = withContentRect()(function (_ref) { | ||
var measure = _ref.measure, | ||
@@ -193,0 +194,0 @@ measureRef = _ref.measureRef, |
@@ -101,4 +101,6 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
}; | ||
_this._resizeObserver = new ResizeObserver(_this.measure); | ||
_this._animationFrameID = null; | ||
_this._resizeObserver = new ResizeObserver(function () { | ||
_this.measure(); | ||
}); | ||
@@ -182,3 +184,3 @@ _this.measure = function (entries) { | ||
var Measure = withContentRect()(function Measure(_ref) { | ||
var Measure = withContentRect()(function (_ref) { | ||
var measure = _ref.measure, | ||
@@ -185,0 +187,0 @@ measureRef = _ref.measureRef, |
@@ -10,3 +10,2 @@ (function (global, factory) { | ||
_inheritsLoose = _inheritsLoose && _inheritsLoose.hasOwnProperty('default') ? _inheritsLoose['default'] : _inheritsLoose; | ||
var react__default = 'default' in react ? react['default'] : react; | ||
PropTypes = PropTypes && PropTypes.hasOwnProperty('default') ? PropTypes['default'] : PropTypes; | ||
@@ -1130,4 +1129,6 @@ | ||
}; | ||
_this._resizeObserver = new index(_this.measure); | ||
_this._animationFrameID = null; | ||
_this._resizeObserver = new index(function () { | ||
_this.measure(); | ||
}); | ||
@@ -1211,3 +1212,3 @@ _this.measure = function (entries) { | ||
var Measure = withContentRect()(function Measure(_ref) { | ||
var Measure = withContentRect()(function (_ref) { | ||
var measure = _ref.measure, | ||
@@ -1214,0 +1215,0 @@ measureRef = _ref.measureRef, |
{ | ||
"name": "react-measure", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Compute measurements of React components.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
@@ -1,8 +0,8 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import withContentRect from './with-content-rect' | ||
const Measure = withContentRect()(function Measure ({ measure, measureRef, contentRect, children }) { | ||
return children({ measure, measureRef, contentRect }) | ||
}) | ||
const Measure = withContentRect()( | ||
({ measure, measureRef, contentRect, children }) => | ||
children({ measure, measureRef, contentRect }) | ||
) | ||
@@ -9,0 +9,0 @@ Measure.displayName = 'Measure' |
@@ -1,2 +0,2 @@ | ||
import React, { Component, createElement } from 'react' | ||
import { Component, createElement } from 'react' | ||
import PropTypes from 'prop-types' | ||
@@ -32,6 +32,8 @@ import ResizeObserver from 'resize-observer-polyfill' | ||
_resizeObserver = new ResizeObserver(this.measure) | ||
_animationFrameID = null | ||
_resizeObserver = new ResizeObserver(() => { | ||
this.measure() | ||
}) | ||
componentWillUnmount() { | ||
@@ -38,0 +40,0 @@ if (this._resizeObserver) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
70432
1516
1