From 3957421314893c58493d7eebf5729b5b54346a3b Mon Sep 17 00:00:00 2001 From: Navaneeth Rao <32010211+navaneeth-dev@users.noreply.github.com> Date: Wed, 8 Jan 2025 09:55:06 +0530 Subject: [PATCH] Remove defaultProps to fix deprecation warning Signed-off-by: Navaneeth Rao <32010211+navaneeth-dev@users.noreply.github.com> --- .../SearchTracePage/SearchResults/ScatterPlot.jsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx index 10a661bdfa..5f42030264 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx +++ b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx @@ -30,7 +30,7 @@ export const CustomTooltip = ({ overValue }) => { }; export default function ScatterPlot(props) { - const { data, onValueClick, calculateContainerWidth } = props; + const { data, onValueClick, calculateContainerWidth = container => container.clientWidth } = props; const containerRef = useRef(null); const [containerWidth, setContainerWidth] = useState(0); @@ -135,8 +135,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, -};