We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01b30bf commit a00294fCopy full SHA for a00294f
packages/react/src/base-chart.js
@@ -10,17 +10,23 @@ export default class BaseChart extends React.Component {
10
// Width prop is mandatory for the wrappers
11
if (props.width) {
12
this.options.width = props.width;
13
- } else {
+ } else if (!this.options.width) {
14
console.error("Missing `width` prop!");
15
}
16
17
// Height prop is mandatory for the wrappers
18
if (props.height) {
19
this.options.height = props.height;
20
+ } else if (!this.options.height) {
21
console.error("Missing `height` prop!");
22
23
24
Object.assign(this, this.chart);
25
26
+
27
+ componentDidUpdate(newProps) {
28
+ const { data } = newProps;
29
30
+ this.chart.setData(data);
31
+ }
32
0 commit comments