gpt4 book ai didi

javascript - 错误 : `createNavigationContainer()` has been removed. 使用 `createAppContainer()` 代替

转载 作者:行者123 更新时间:2023-12-04 11:00:59 24 4
gpt4 key购买 nike

正如您在我的简单代码中看到的,我没有使用 createNavigationContainer/createAppContainer,但我收到了那个错误。我不知道为什么会这样。我被卡住了!

import React, { Component } from 'react';
import {Router, Stack, Scene} from 'react-native-router-flux';

import LogIn from './pages/LogIn';
import SignUp from './pages/SignUp';
import { View } from 'react-native';


export default class Routes extends React.Component {

render(){
return(
<Router>
<Stack key="root" hideNavBar={true}>
<Scene key="LogIn" component={LogIn} title="Login" initial={true}/>
<Scene key="SignUp" component={SignUp} title="SignUp"/>
</Stack>

</Router>

);
}
}


enter image description here >
  "dependencies": {
"expo": "^35.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-gesture-handler": "~1.3.0",
"react-native-reanimated": "~1.2.0",
"react-native-router-flux": "^4.0.6",
"react-native-screens": "~1.0.0-alpha.23",
"react-native-web": "^0.11.7",
"react-navigation": "^4.0.10",
"react-redux": "^7.1.3",
"react-scripts": "^3.2.0",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0",

最佳答案

试试这个,看看它是否适合你

npm i react-navigation-stack --save

如果这不起作用,请尝试升级您的软件包

引用 link

关于javascript - 错误 : `createNavigationContainer()` has been removed. 使用 `createAppContainer()` 代替,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58797720/

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