Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {StackNavigator, DrawerNavigator} from 'react-navigation';
- export default class HomeScreen extends React.Component {
- constructor(props) {
- super(props)
- this.clicked = this.clicked.bind(this)
- }
- static navigationOptions = {
- drawerLabel: 'Home',
- };
- clicked = ()=> {
- this.props.navigator.navigate('DrawerOpen'); // open drawer
- }
- render() {
- // const {navigate} = this.props.navigation;
- return (
- <ScrollView>
- <View style={styles.container}>
- <View style={styles.header}>
- <View style={{width: 50}}>
- <TouchableHighlight onPress={()=> {
- this.clicked("DrawerOpen")
- }}>
- <Image source={require('./img/hamburger_icon.png')}/>
- </TouchableHighlight>
- </View>
- </View>
- </View>
- </ScrollView >
- )
- }
- }
- undefined is not an object (evaluating '_this.props.navigator.navigate')
- clicked
- import {StackNavigator, DrawerNavigator} from 'react-navigation';
- export default class HomeScreen extends React.Component {
- static navigationOptions = {
- drawerLabel: 'Home',
- };
- clicked = () => {
- this.props.navigator.navigate('DrawerOpen'); // open drawer
- }
- render() {
- // const {navigate} = this.props.navigation;
- return (
- <ScrollView>
- <View style={styles.container}>
- <View style={styles.header}>
- <View style={{width: 50}}>
- <TouchableHighlight onPress={()=>
- this.clicked()
- }>
- <Image source={require('./img/hamburger_icon.png')}/>
- </TouchableHighlight>
- </View>
- </View>
- </View>
- </ScrollView >
- )
- }
- }
- clicked = ()=> {
- this.props.navigation.navigate('DrawerOpen');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement