Created
June 10, 2020 16:01
-
-
Save heygema/eb8a831014a422268ea9411ee448ff59 to your computer and use it in GitHub Desktop.
nih josh
This file contains hidden or 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
import React from 'react'; | |
import {View, StyleSheet, Button} from 'react-native'; | |
import {Navigator, Route} from './Navigator'; | |
function Screen1({navigator}) { | |
return ( | |
<View style={[styles.screen, {backgroundColor: '#59C9A5'}]}> | |
<Button title="Screen 2" onPress={() => navigator.push('Screen2')} /> | |
<Button title="Pop" onPress={() => navigator.pop()} /> | |
</View> | |
); | |
} | |
function Screen2({navigator}) { | |
return ( | |
<View style={[styles.screen, {backgroundColor: '#23359B'}]}> | |
<Button title="Screen 3" onPress={() => navigator.push('Screen3')} /> | |
<Button title="Pop" onPress={() => navigator.pop()} /> | |
</View> | |
); | |
} | |
function Screen3({navigator}) { | |
return ( | |
<View style={[styles.screen, {backgroundColor: '#B9E3C6'}]}> | |
<Button title="Pop" onPress={() => navigator.pop()} /> | |
</View> | |
); | |
} | |
function App() { | |
return ( | |
<Navigator> | |
<Route name="Screen1" component={Screen1} /> | |
<Route name="Screen2" component={Screen2} /> | |
<Route name="Screen3" component={Screen3} /> | |
</Navigator> | |
); | |
} | |
const styles = StyleSheet.create({ | |
screen: { | |
flex: 1, | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
}); | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment