gpt4 book ai didi

javascript - 未处理的 JS 异常 : Requiring unknown module "9"

转载 作者:行者123 更新时间:2023-12-04 15:26:09 25 4
gpt4 key购买 nike

所以我正在尝试为登录屏幕设置导航,我尝试重新链接依赖项并重新安装包,但我只处理了两个文件。我在 MacOS 上工作并在 iOS 13.5 上模拟。

This is the complete error when trying to simulate.

App.js

import React, { Component } from 'react'
import {
StyleSheet,
View
} from 'react-native'

import Mystack from './navigators/StackNavigator'

export default class App extends Component {

render() {
return (
<NavigationContainer>
<Mystack/>
</NavigationContainer>
)
}}
const styles = StyleSheet.create({
container: {
},
})

和 StackNavigator.js

import * as React from 'react';
import { createStackNavigator} from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import LogIn from './src/components/LogIn.js'
import SignUp from './src/components/SignUp.js'
import Dashboard from './src/components/Dashboard.js'

const Stack = createStackNavigator();

function Mystack() {
return(
<Stack.Navigator initialRouteName = "LogIn"
screenOptions = {{
headerTitleAlign: 'center',
HeaderStyle: {
backgroundColor: "#FFF700",
},
headerTintColor: '#FFF',
headerTitleStyle: {
fontWeight: 'bold',
},
}}>
<Stack.Screen name = "LogIn"
component = {LogIn}
options = {{
title: 'LogIn',
headerShown: false
}}/>
<Stack.Screen name = "SignUp"
component = {SignUp}
options = {{
title: 'SignUp',
headerShown: false
}}/>
<Stack.Screen name = "Dashboard"
component = {Dashboard}
options = {{
title: 'Dashboard'
}
}/>
</Stack.Navigator>
)

}

export default Mystack;

最佳答案

我不确定它是否是正确的解决方案,但重新启动包(Metro 服务器)对我有用。

关于javascript - 未处理的 JS 异常 : Requiring unknown module "9",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62206576/

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