Skip to content

Commit

Permalink
Remove defaultProps from ScatterPlot.jsx (#2618)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Part of #2596 

## Description of the changes
- 

## How was this change tested?
- 

## Checklist
- [ ] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [ ] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [ ] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: cs-308-2023 <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
  • Loading branch information
ADI-ROXX and yurishkuro authored Jan 27, 2025
1 parent 48733c2 commit 4e668e9
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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,
};

0 comments on commit 4e668e9

Please sign in to comment.