🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-break

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-break - npm Package Compare versions

Comparing version

to
1.3.1

12

lib/react-break.js

@@ -84,3 +84,3 @@ 'use strict';

_this.forceUpdate();
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
}, _this.mounted = false, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
}

@@ -91,2 +91,3 @@

value: function componentDidMount() {
this.mounted = true;
this.onBreakpointsChange();

@@ -97,2 +98,3 @@ }

value: function componentWillUnmount() {
this.mounted = false;
this.state.layout.removeChangeListener(this.onLayoutChange);

@@ -103,5 +105,7 @@ }

value: function onBreakpointsChange() {
this.setState({ layout: (0, _breakjs2.default)(this.props.breakpoints) });
this.state.layout.removeChangeListener(this.onLayoutChange);
this.state.layout.addChangeListener(this.onLayoutChange);
if (this.mounted) {
this.setState({ layout: (0, _breakjs2.default)(this.props.breakpoints) });
this.state.layout.removeChangeListener(this.onLayoutChange);
this.state.layout.addChangeListener(this.onLayoutChange);
}
}

@@ -108,0 +112,0 @@ }, {

{
"name": "react-break",
"version": "1.3.0",
"version": "1.3.1",
"description": "Responsive breakpoints in React.",

@@ -5,0 +5,0 @@ "main": "./lib/react-break.js",

@@ -34,2 +34,3 @@ import React, { PureComponent } from 'react';

componentDidMount() {
this.mounted = true;
this.onBreakpointsChange();

@@ -39,2 +40,3 @@ }

componentWillUnmount() {
this.mounted = false;
this.state.layout.removeChangeListener(this.onLayoutChange);

@@ -44,5 +46,7 @@ }

onBreakpointsChange() {
this.setState({ layout: breakjs(this.props.breakpoints) });
this.state.layout.removeChangeListener(this.onLayoutChange);
this.state.layout.addChangeListener(this.onLayoutChange);
if (this.mounted) {
this.setState({ layout: breakjs(this.props.breakpoints) });
this.state.layout.removeChangeListener(this.onLayoutChange);
this.state.layout.addChangeListener(this.onLayoutChange);
}
}

@@ -54,2 +58,4 @@

mounted = false
render() {

@@ -56,0 +62,0 @@ const {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display