Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created May 2, 2021 19:28
Show Gist options
  • Save AllGistsEqual/d8d2a15cdd4365bb934ad7c847fa773d to your computer and use it in GitHub Desktop.
Save AllGistsEqual/d8d2a15cdd4365bb934ad7c847fa773d to your computer and use it in GitHub Desktop.
// File src/screens/HomeScreenB.tsx // and HomeScreenC.tsx
import React from 'react'
import { Text, View, StyleSheet, Button } from 'react-native'
import { MainNavigationProp } from '../../routing/types'
import { MainRoutes } from '../../routing/routes'
type HomeScreenProps = {
navigation: MainNavigationProp<MainRoutes.Home>
}
const HomeScreenB = ({ navigation }: HomeScreenProps): React.ReactElement => (
<View style={styles.page}>
<Text>Seection B</Text>
<Button title="settings" onPress={() => navigation.navigate(MainRoutes.Settings)} />
</View>
)
const styles = StyleSheet.create({
page: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
})
export default HomeScreenB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment