react-measure
Advanced tools
Comparing version 2.5.1 to 2.5.2
## CHANGELOG | ||
### 2.5.2 | ||
Default to global (possibly polyfilled) ResizeObserver if the local window does not have ResizeObserver #148 | ||
### 2.5.1 | ||
@@ -4,0 +8,0 @@ |
@@ -173,3 +173,3 @@ 'use strict'; | ||
_proto.componentDidMount = function componentDidMount() { | ||
this._resizeObserver = this.window !== null ? new this._window.ResizeObserver(this.measure) : new ResizeObserver(this.measure); | ||
this._resizeObserver = this._window !== null && this._window.ResizeObserver ? 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 = this.window !== null ? new this._window.ResizeObserver(this.measure) : new ResizeObserver(this.measure); | ||
this._resizeObserver = this._window !== null && this._window.ResizeObserver ? 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 = this.window !== null ? new this._window.ResizeObserver(this.measure) : new index(this.measure); | ||
this._resizeObserver = this._window !== null && this._window.ResizeObserver ? new this._window.ResizeObserver(this.measure) : new index(this.measure); | ||
@@ -1233,0 +1233,0 @@ if (this._node !== null) { |
{ | ||
"name": "react-measure", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"description": "Compute measurements of React components.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
@@ -42,3 +42,3 @@ import { Component, createElement } from 'react' | ||
componentDidMount() { | ||
this._resizeObserver = this.window !== null | ||
this._resizeObserver = (this._window !== null && this._window.ResizeObserver) | ||
? new this._window.ResizeObserver(this.measure) | ||
@@ -45,0 +45,0 @@ : new ResizeObserver(this.measure); |
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
80455