Skip to content

Instantly share code, notes, and snippets.

@biyootiful
Created November 2, 2017 20:16
Show Gist options
  • Save biyootiful/77627f345f08986cc07c69f677b75b8f to your computer and use it in GitHub Desktop.
Save biyootiful/77627f345f08986cc07c69f677b75b8f to your computer and use it in GitHub Desktop.
react-native-intro-anim
export default class App extends Component {
state = {
currentScreen: "intro"
};
router(page) {
this.setState({ currentScreen: page });
}
renderScreen() {
const { currentScreen } = this.state;
switch (currentScreen) {
case "intro":
return <Intro router={this.router.bind(this)}/>;
case "next page":
return <NextPage />;
default:
return <Text style={styles.introText}>Something went wrong</Text>;
}
}
render() {
return <View style={styles.wrapper}>{this.renderScreen()}</View>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment