Skip to content

Commit

Permalink
fix: pass all props to transformProps in LineMulti chart (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
nytai authored and zhaoyongjie committed Nov 26, 2021
1 parent 180c72b commit ade25f4
Showing 1 changed file with 6 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ const propTypes = {
annotationData: PropTypes.object,
datasource: PropTypes.object,
formData: PropTypes.object,
onAddFilter: PropTypes.func,
onError: PropTypes.func,
};
const defaultProps = {
onAddFilter() {},
onError() {},
hooks: PropTypes.shape({
onAddFilter: PropTypes.func,
onError: PropTypes.func,
}),
};
const defaultProps = {};

function getJson(url) {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -137,27 +136,12 @@ class LineMulti extends React.Component {
}

render() {
const {
width,
height,
annotationData,
datasource,
formData,
onAddFilter,
onError,
} = this.props;
const { queryData } = this.state;

return (
<ReactNVD3
{...transformProps({
width,
height,
annotationData,
datasource,
formData,
onError,
onAddFilter,
...this.props,
queryData,
})}
/>
Expand Down

0 comments on commit ade25f4

Please sign in to comment.