diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-02-27 14:47:13 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-02-27 14:47:13 +0100 |
| commit | 76d2e0ec0e15c05e4c053c11e84df7da0fb25e3e (patch) | |
| tree | 5f04d6e249941ad491ba48ae157971436bc59f16 /app/components | |
| parent | e1bbc9a1b786b49150920d9a4b54138a5ca99691 (diff) | |
| download | mullvadvpn-76d2e0ec0e15c05e4c053c11e84df7da0fb25e3e.tar.xz mullvadvpn-76d2e0ec0e15c05e4c053c11e84df7da0fb25e3e.zip | |
Use React key to make sure we do not remount the old view on transition
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/TransitionContainer.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/components/TransitionContainer.js b/app/components/TransitionContainer.js index c4a011a978..70a92c47d0 100644 --- a/app/components/TransitionContainer.js +++ b/app/components/TransitionContainer.js @@ -187,11 +187,12 @@ export default class TransitionContainer extends Component<TransitionContainerPr <View style={{flex:1}}> { previousChildren && - (<Animated.View style={[this.state.animationStyles.style, previousChildrenAnimation]}> + (<Animated.View key={ previousChildren && previousChildren.key } + style={[this.state.animationStyles.style, previousChildrenAnimation]}> { previousChildren } </Animated.View>) } - <Animated.View style={[this.state.animationStyles.style, childrenAnimation]}> + <Animated.View key={ children.key } style={[this.state.animationStyles.style, childrenAnimation]}> { children } </Animated.View> |
