Skip to content

Commit

Permalink
Use ResizeObserver polyfill in older browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
zbynek committed Jun 6, 2021
1 parent 7768ce6 commit cb469ba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"dependencies": {
"@babel/core": "^7.14.3",
"@halkeye/react-paginate": "^7.2.3",
"@juggle/resize-observer": "^3.3.1",
"@sentry/browser": "^6.5.1",
"algoliasearch": "^4.9.1",
"chart.js": "^3.3.2",
Expand Down
2 changes: 2 additions & 0 deletions src/components/LineChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import {Line} from 'react-chartjs-2';
import moment from 'moment';
import {ResizeObserver as ResizeObserverPolyfill} from '@juggle/resize-observer';

const calculateMax = (data) => {
return 1.2 * Math.max(...data);
Expand Down Expand Up @@ -63,6 +64,7 @@ const styles = {
};

function LineChart({installations}) {
window.ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill;
if (!installations) {
return null;
}
Expand Down

0 comments on commit cb469ba

Please sign in to comment.