Created
November 2, 2017 20:16
-
-
Save biyootiful/77627f345f08986cc07c69f677b75b8f to your computer and use it in GitHub Desktop.
react-native-intro-anim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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