Skip to content

Commit

Permalink
NavigationTransitioner animation bug demostration
Browse files Browse the repository at this point in the history
  • Loading branch information
gitim committed Nov 5, 2016
1 parent 1ceb2f7 commit 46dd8c9
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class ExampleNavigator extends Component {
}
}

let num = 1;
class ExampleScene extends Component {
props: NavigationSceneRendererProps & {
navigate: Function,
Expand All @@ -181,6 +182,17 @@ class ExampleScene extends Component {
navigate: PropTypes.func.isRequired,
};

componentDidMount() {
if (num !== 3) {
setTimeout(() => this.props.navigate('push'), 300);
num++;
}
}

componentWillUnmount() {
num = 1;
}

render(): React.Element<any> {
const {scene, navigate} = this.props;
return (
Expand Down Expand Up @@ -222,7 +234,7 @@ class ExampleScene extends Component {
const width = layout.initWidth;
const translateX = position.interpolate({
inputRange,
outputRange: ([width, 0, -10]: Array<number>),
outputRange: ([width, 0, -100]: Array<number>),
});

return {
Expand Down

0 comments on commit 46dd8c9

Please sign in to comment.