diff --git a/packages/react/src/base-chart.js b/packages/react/src/base-chart.js index 91d569936b..cc42104ec2 100644 --- a/packages/react/src/base-chart.js +++ b/packages/react/src/base-chart.js @@ -10,17 +10,23 @@ export default class BaseChart extends React.Component { // Width prop is mandatory for the wrappers if (props.width) { this.options.width = props.width; - } else { + } else if (!this.options.width) { console.error("Missing `width` prop!"); } // Height prop is mandatory for the wrappers if (props.height) { this.options.height = props.height; - } else { + } else if (!this.options.height) { console.error("Missing `height` prop!"); } Object.assign(this, this.chart); } + + componentDidUpdate(newProps) { + const { data } = newProps; + + this.chart.setData(data); + } }