diff --git a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx index a28e6453d5..af92462c00 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx +++ b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx @@ -23,9 +23,13 @@ import { ONE_MILLISECOND, formatDuration } from '../../../utils/date'; import 'react-vis/dist/style.css'; import './ScatterPlot.css'; -export default function ScatterPlot(props) { - const { data, onValueClick, calculateContainerWidth } = props; - +export default function ScatterPlot({ + data, + onValueClick, + // JSDOM does not, as of 2023, have a layout engine, + // so allow tests to supply a mock width as a workaround + calculateContainerWidth = container => container.clientWidth, +}) { const containerRef = useRef(null); const [containerWidth, setContainerWidth] = useState(0); @@ -103,8 +107,3 @@ ScatterPlot.propTypes = { onValueClick: PropTypes.func.isRequired, calculateContainerWidth: PropTypes.func, }; - -ScatterPlot.defaultProps = { - // JSDOM does not, as of 2023, have a layout engine, so allow tests to supply a mock width as a workaround. - calculateContainerWidth: container => container.clientWidth, -};