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.5.1 to 2.5.2

4

CHANGELOG.md
## 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 @@

2

dist/index.cjs.js

@@ -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);

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