diff --git a/packages/animated-switch/index.js b/packages/animated-switch/index.js index c6875ebe..41e67389 100644 --- a/packages/animated-switch/index.js +++ b/packages/animated-switch/index.js @@ -12,9 +12,11 @@ const DEFAULT_TRANSITION = ( class SwitchView extends React.Component { containerRef = React.createRef(); - componentDidUpdate() { - this.containerRef.current && - this.containerRef.current.animateNextTransition(); + componentDidUpdate(prevProps) { + if (this.props.navigation.state.index !== prevProps.navigation.state.index) { + this.containerRef.current && + this.containerRef.current.animateNextTransition(); + } } render() { diff --git a/packages/animated-switch/package.json b/packages/animated-switch/package.json index dce89fc5..f14f216e 100644 --- a/packages/animated-switch/package.json +++ b/packages/animated-switch/package.json @@ -1,6 +1,6 @@ { "name": "react-navigation-animated-switch", - "version": "0.1.0", + "version": "0.1.1", "description": "", "main": "index.js", "author": "",