Skip to content

Commit 54f5cd5

Browse files
committed
replace react-resize-detector
1 parent cb5b75b commit 54f5cd5

File tree

4 files changed

+47
-163
lines changed

4 files changed

+47
-163
lines changed

components/dash-core-components/package-lock.json

Lines changed: 8 additions & 147 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/dash-core-components/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"react-dropzone": "^4.1.2",
5858
"react-fast-compare": "^3.2.2",
5959
"react-markdown": "^4.3.1",
60-
"react-resize-detector": "^6.7.6",
6160
"react-select-fast-filter-options": "^0.2.3",
6261
"react-virtualized-select": "^3.1.3",
6362
"remark-math": "^3.0.1",
@@ -73,7 +72,6 @@
7372
"@plotly/dash-component-plugins": "^1.2.3",
7473
"@plotly/webpack-dash-dynamic-import": "^1.3.0",
7574
"babel-loader": "^9.2.1",
76-
"component-playground": "^3.2.1",
7775
"copyfiles": "^2.4.1",
7876
"css-loader": "^6.8.1",
7977
"es-check": "^7.1.1",
@@ -84,8 +82,6 @@
8482
"identity-obj-proxy": "^3.0.0",
8583
"npm-run-all": "^4.1.5",
8684
"prettier": "^2.8.8",
87-
"react": "^16.14.0",
88-
"react-dom": "^16.14.0",
8985
"react-jsx-parser": "1.21.0",
9086
"rimraf": "^5.0.5",
9187
"style-loader": "^3.3.3",
@@ -101,8 +97,8 @@
10197
"/lib/"
10298
],
10399
"peerDependencies": {
104-
"react": ">=16",
105-
"react-dom": ">=16"
100+
"react": "16 - 19",
101+
"react-dom": "16 - 19"
106102
},
107103
"browserslist": [
108104
"last 9 years and not dead"

components/dash-core-components/src/fragments/Graph.react.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import lazyLoadMathJax from '../utils/LazyLoader/mathjax';
22
import React, {Component} from 'react';
3-
// /build/withPolyfill for IE11 support - https://github.com/maslianok/react-resize-detector/issues/144
4-
import ResizeDetector from 'react-resize-detector/build/withPolyfill';
53
import {
64
equals,
75
filter,
@@ -16,6 +14,8 @@ import PropTypes from 'prop-types';
1614
import {graphPropTypes, graphDefaultProps} from '../components/Graph.react';
1715
/* global Plotly:true */
1816

17+
import ResizeDetector from '../utils/ResizeDetector';
18+
1919
/**
2020
* `autosize: true` causes Plotly.js to conform to the parent element size.
2121
* This is necessary for `dcc.Graph` call to `Plotly.Plots.resize(target)` to do something.
@@ -526,14 +526,7 @@ class PlotlyGraph extends Component {
526526
className={className}
527527
style={style}
528528
>
529-
<ResizeDetector
530-
handleHeight={true}
531-
handleWidth={true}
532-
refreshMode="debounce"
533-
refreshOptions={{trailing: true}}
534-
refreshRate={50}
535-
onResize={this.graphResize}
536-
/>
529+
<ResizeDetector onResize={this.graphResize} />
537530
<div ref={this.gd} style={{height: '100%', width: '100%'}} />
538531
</div>
539532
);

0 commit comments

Comments
 (0)