Skip to content

Instantly share code, notes, and snippets.

@Yassir4
Created July 31, 2019 17:56
Show Gist options
  • Save Yassir4/faf33038493993a307af465edc29580f to your computer and use it in GitHub Desktop.
Save Yassir4/faf33038493993a307af465edc29580f to your computer and use it in GitHub Desktop.
import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Navigation} from 'react-native-navigation';
import styles from './styles';
const pushScreen = props => {
const {componentId} = props;
Navigation.push(componentId, {
component: {
name: 'PushedScreen',
},
});
};
const Home = props => {
return (
<View style={styles.container}>
<View style={styles.buttonsSection}>
<TouchableOpacity
onPress={() => pushScreen(props)}
style={styles.buttonWrapper}>
<Text style={styles.buttonText}>Push Screen</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonWrapper}>
<Text style={styles.buttonText}>open a modal</Text>
</TouchableOpacity>
</View>
</View>
);
};
export default Home;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment