if (this.props.singleColumn !== prevProps.singleColumn && !this.props.singleColumn) {
this.node.addEventListener('wheel', this.handleWheel, supportsPassiveEvents ? { passive: true } : false);
}
- this.lastIndex = getIndex(this.context.router.history.location.pathname);
- this.setState({ shouldAnimate: true });
+
+ const newIndex = getIndex(this.context.router.history.location.pathname);
+
+ if (this.lastIndex !== newIndex) {
+ this.lastIndex = newIndex;
+ this.setState({ shouldAnimate: true });
+ }
}
componentWillUnmount () {