An issue has been encountered on the node.js window:
error: bundling failed: Error: Unable to resolve module react-native-gesture-handler
from
node_modules\@react-navigation\native\src\Scrollables.js
: react-native-gesture-handler could not be found within the project.
The error seems to be linked to the npm or yarn libraries.
This is the code in App.js:
import React, {Component} from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
Button
} from 'react-native';
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation';
class FirstPage extends Component{
render(){
return(
<View>
<Text>This is the first page.</Text>
<Button onPress={()=>this.props.navigation.navigate('test')} title="Go to the second page"/>
</View>
)
}
}
class SecondPage extends Component{
render(){
return(
<View>
<Text>This is the second page.</Text>
<Button onPress={()=>this.props.navigation.navigate('home')} title="Go to the first page"/>
</View>
)
}
}
export default createStackNavigator({
home:FirstPage,
test:SecondPage
});