gpt4 book ai didi

javascript - 开发服务器返回响应错误码: 500 react-native

转载 作者:行者123 更新时间:2023-11-30 13:46:35 26 4
gpt4 key购买 nike

node.js 窗口错误:错误:捆绑失败:错误:无法从 node_modules\@react-navigation\native\src\Scrollables.js 解析模块 react-native-gesture-handler:react-在项目中找不到 native 手势处理程序。

我认为错误与 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

希望对您有所帮助。有疑问请随意

关于javascript - 开发服务器返回响应错误码: 500 react-native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59208376/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com