我收到這個錯誤[Sat Jul 25 2020 09:51:01.475] ERROR Error: The component for route 'ViewPayments' must be a React component. For example:import MyScreen from './MyScreen';...ViewPayments: MyScreen,}You can also use a navigator:import MyNavigator from './MyNavigator';...ViewPayments: MyNavigator,}[Sat Jul 25 2020 09:51:01.485] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)[Sat Jul 25 2020 09:51:01.487] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)我想知道為什么這個錯誤是我的 App.js 代碼的樣子。ViewPayments 看起來像這樣:import React, { Component } from 'react';import { View, Text } from 'react-native';class ViewPayments extends Component { static navigationOptions = { title : "View Payments" } render() { return ( <View> <Text> ViewPayments </Text> </View> ); }}export default ViewPayments;一切似乎都很好,我什至把它當作屏幕,請問明顯有什么問題?我已經搜索并嘗試了我在互聯網上看到的幾種方法,但都無濟于事,在這種情況下似乎出了什么問題?當我編譯時,我將其作為返回錯誤
錯誤錯誤:路由“ViewPayments”的組件必須是 React 組件。例如:
慕容3067478
2022-12-02 16:19:04
