children: PropTypes.node,
};
+ state = {
+ shouldAnimate: false,
+ }
+
+ componentWillReceiveProps() {
+ this.setState({ shouldAnimate: false });
+ }
+
+ componentDidMount() {
+ this.lastIndex = getIndex(this.context.router.history.location.pathname);
+ this.setState({ shouldAnimate: true });
+ }
+
componentDidUpdate() {
this.lastIndex = getIndex(this.context.router.history.location.pathname);
+ this.setState({ shouldAnimate: true });
}
handleSwipe = (index) => {
render () {
const { columns, children, singleColumn } = this.props;
+ const { shouldAnimate } = this.state;
const columnIndex = getIndex(this.context.router.history.location.pathname);
- const shouldAnimate = Math.abs(this.lastIndex - columnIndex) === 1;
+ this.pendingIndex = null;
if (singleColumn) {
return columnIndex !== -1 ? (