Skip to content

Commit

Permalink
Remove defaultProps to fix deprecation warning
Browse files Browse the repository at this point in the history
Signed-off-by: Navaneeth Rao <[email protected]>
  • Loading branch information
navaneeth-dev committed Jan 9, 2025
1 parent e510888 commit 3957421
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
};

0 comments on commit 3957421

Please sign in to comment.