react-image-slider
react-image-slider copied to clipboard
Performance/Unmount issue
When I navigate somewhere else and the slider gets unmounted the animate interval wont stop.
FIX:
componentWillUnmount() {
window.removeEventListener('resize', this.setVisibleItems.bind(this, this.props.visibleItems));
if (this.state.interval) {
clearInterval(this.state.interval);
this.setState({ interval: null });
}
}