Open mrecachinas opened 5 years ago
In src/hreflayer.js and src/websocketlayer.js,
componentDidMount() { const { href, onload, options } = this.props; this.plot.deoverlay(); // <---------------- this.layer = this.plot.overlay_href(href, onload, options); } componentWillReceiveProps(nextProps) { const { href: oldHref, options: oldOptions, } = this.props; const { href: newHref, onload: newOnload, options: newOptions, } = nextProps; // we only care if `href` or `options` changes if (newHref !== oldHref) { this.plot.deoverlay(); // <---------------- this.plot.overlay_href(newHref, newOnload, newOptions); } else if (newOptions !== oldOptions) { this.plot.change_settings(newOptions); } else { return; } }
src/websocketlayer.js looks roughly the same.
In src/hreflayer.js and src/websocketlayer.js,
src/websocketlayer.js looks roughly the same.