Skip to content

Commit 51c5454

Browse files
committed
Pass config on update redraw
1 parent 4764a8b commit 51c5454

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PlotlyComponent.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ let createPlotlyComponent = (plotlyInstance) => React.createClass({
4040

4141
componentDidUpdate(prevProps) {
4242
//TODO use minimal update for given changes
43-
if (prevProps.data !== this.props.data || prevProps.layout !== this.props.layout) {
44-
plotlyInstance.newPlot(this.container, this.props.data, this.props.layout);
43+
if (prevProps.data !== this.props.data || prevProps.layout !== this.props.layout || prevProps.config !== this.props.config) {
44+
let {data, layout, config} = this.props;
45+
plotlyInstance.newPlot(this.container, data, cloneDeep(layout), config); //We clone the layout as plotly mutates it.
4546
this.attachListeners();
4647
}
4748
},

0 commit comments

Comments
 (0)