diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-02-27 16:12:19 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-02-27 16:12:19 +0100 |
| commit | 2e635e146ebb6d83c7c057941409aee9aee5eeb2 (patch) | |
| tree | 00998c02a6b01b00eb9609cfad287afe2a81a523 | |
| parent | e1bbc9a1b786b49150920d9a4b54138a5ca99691 (diff) | |
| parent | d6957f43d8dfe9f2346f096106474757869cba6b (diff) | |
| download | mullvadvpn-2e635e146ebb6d83c7c057941409aee9aee5eeb2.tar.xz mullvadvpn-2e635e146ebb6d83c7c057941409aee9aee5eeb2.zip | |
Merge branch 'fix-transition-container-remounting'
| -rw-r--r-- | app/components/TransitionContainer.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/components/TransitionContainer.js b/app/components/TransitionContainer.js index c4a011a978..c4f6e459f3 100644 --- a/app/components/TransitionContainer.js +++ b/app/components/TransitionContainer.js @@ -16,6 +16,11 @@ type State = { dimensions: Types.Dimensions, }; +const transitionContainerStyle = Styles.createViewStyle({ + flex: 1, + position: 'relative' +}); + export default class TransitionContainer extends Component<TransitionContainerProps, State> { constructor(props: TransitionContainerProps) { @@ -184,14 +189,15 @@ export default class TransitionContainer extends Component<TransitionContainerPr const { children } = this.props; const { previousChildren, childrenAnimation, previousChildrenAnimation } = this.state; return ( - <View style={{flex:1}}> + <View style={[ transitionContainerStyle ]}> { 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> |
