Trying to navigate screen to another but there is mistake

#1

Hi
i’m new in react native and expo
i have try to navigate screen to another but i’m getting an error

import React from 'react';
import {
  Text,
  View,
} from 'react-native';

import {
  StackNavigator,
} from 'react-navigation';
import {Screen3} from './Screen3';

class HomeScreen extends React.Component {


  render() {
    return (
        <View style={{alignItems: 'center', justifyContent: 'center', flex: 1}}>
          <Text onPress={this._handlePress}>HomeScreen!</Text>
        </View>
      )
  }
  _handlePress = () => {
    this.props.navigation.navigate('Screen3');
}


}
export const HomeStack = StackNavigator({
  Home: { screen: HomeScreen },
  Screen3: { screen: Screen3, },

});

import React from 'react';
import {
  Text,
  View,
} from 'react-native';

import {
  StackNavigator,
} from 'react-navigation';

class Screen3 extends React.Component {


  render() {
    return (
      <View style={{alignItems: 'center', justifyContent: 'center', flex: 1}}>
      <Text>Helllooo</Text>
      </View>
    )
  }

  }

export default Screen3;

#2

What’s the error you’re getting ?

1 Like