react-measure
Advanced tools
Comparing version 2.5.0 to 2.5.1
## CHANGELOG | ||
### 2.5.1 | ||
Use `ResizeObserver` of local `window` object #147 | ||
### 2.5.0 | ||
Set `innerRef` before observing [#140](https://github.com/souporserious/react-measure/pull/140) | ||
### 2.4.0 | ||
Use the local `window` object of the observed node [#146](https://github.com/souporserious/react-measure/pull/146) | ||
### 2.3.0 | ||
@@ -4,0 +16,0 @@ |
@@ -173,3 +173,3 @@ 'use strict'; | ||
_proto.componentDidMount = function componentDidMount() { | ||
this._resizeObserver = new ResizeObserver(this.measure); | ||
this._resizeObserver = this.window !== null ? new this._window.ResizeObserver(this.measure) : new ResizeObserver(this.measure); | ||
@@ -176,0 +176,0 @@ if (this._node !== null) { |
@@ -167,3 +167,3 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
_proto.componentDidMount = function componentDidMount() { | ||
this._resizeObserver = new ResizeObserver(this.measure); | ||
this._resizeObserver = this.window !== null ? new this._window.ResizeObserver(this.measure) : new ResizeObserver(this.measure); | ||
@@ -170,0 +170,0 @@ if (this._node !== null) { |
@@ -1230,3 +1230,3 @@ (function (global, factory) { | ||
_proto.componentDidMount = function componentDidMount() { | ||
this._resizeObserver = new index(this.measure); | ||
this._resizeObserver = this.window !== null ? new this._window.ResizeObserver(this.measure) : new index(this.measure); | ||
@@ -1233,0 +1233,0 @@ if (this._node !== null) { |
{ | ||
"name": "react-measure", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "Compute measurements of React components.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
@@ -42,3 +42,5 @@ import { Component, createElement } from 'react' | ||
componentDidMount() { | ||
this._resizeObserver = new ResizeObserver(this.measure) | ||
this._resizeObserver = this.window !== null | ||
? new this._window.ResizeObserver(this.measure) | ||
: new ResizeObserver(this.measure); | ||
if (this._node !== null) { | ||
@@ -45,0 +47,0 @@ this._resizeObserver.observe(this._node) |
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
80204
1761