react-navigation-animated-switch
Advanced tools
Comparing version
10
index.js
@@ -16,5 +16,9 @@ import * as React from 'react'; | ||
componentDidUpdate(prevProps) { | ||
if (this.props.navigation.state.index !== prevProps.navigation.state.index) { | ||
this.containerRef.current && | ||
this.containerRef.current.animateNextTransition(); | ||
const { state: prevState } = prevProps.navigation; | ||
const prevActiveKey = prevState.routes[prevState.index].key; | ||
const { state } = this.props.navigation; | ||
const activeKey = state.routes[state.index].key; | ||
if (activeKey !== prevActiveKey && this.containerRef.current) { | ||
this.containerRef.current.animateNextTransition(); | ||
} | ||
@@ -21,0 +25,0 @@ } |
{ | ||
"name": "react-navigation-animated-switch", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3569
4.94%50
6.38%