node.js窗口上的错误:错误:捆绑失败:错误:无法react-native-gesture-handler
从node_modules\@react-navigation\native\src\Scrollables.js
项目中找到以下模块来解析模块:react-native-gesture-handler。
我认为该错误与npm或yarn的库有关。
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
});
您需要安装以下软件包以及raeact导航才能使其正常运行,
您可以添加
yarn add react-navigation react-native-gesture-handler react-native-reanimated react-native-screens
要么
npm i react-navigation react-native-gesture-handler react-native-reanimated react-native-screens
希望能帮助到你。毫无疑问
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句