有了新的react导航v5,它就不可能与react-native-web一起使用了。仅仅导入createBrowserApp就会抛出错误 import {createBrowserApp} from "@react-navigation/web"; 在@反应导航/web/dist/Link.js中显示以下错误 TypeError: (0 , _core.withNavigation) is not a function 有没有人知道如何在react-native- v5中使用react导航web?我需要路径中的url历史,但现在它已经变得不可能了。
我希望能够在屏幕上隐藏选项卡,使用本机导航v5。
我一直在阅读文档,但似乎他们并没有为v5更新这个文档,它引用了< v4的做事方式。
这是我的代码:
import Home from './components/Home';
import SettingsScreen from './components/Settings';
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
impo
我的应用程序显示了两个标题。我只想要一个标题,我所遵循的教程工作得很好,但不是我。导师使用的是react导航v5,我使用的是v6。这是可能想要看的代码。我有三个屏幕,一个堆栈有两个屏幕,另一个有一个屏幕。请帮我修一下。
import * as React from "react";
import { createDrawerNavigator } from "@react-navigation/drawer";
import { NavigationContainer } from "@react-navigation/native";
impo
在我的React Native应用程序中,我使用的是react导航版本5。 如何将导航对象传递到BottomNavigation中的场景 下面是我创建BottomNavigation的组件 import React from 'react';
import { BottomNavigation } from 'react-native-paper';
// Components
import CodeScanner from '../../../screens/vendors/CodeScannerScreen';
import Home f
我正在尝试使用react导航来实现堆栈导航。当我创建一个堆栈导航const并在我的默认屏幕中调用时,它给了我这个错误。
路由'Main‘应该声明一个屏幕。例如:从‘./ MyScreen’导入MyScreen;主页:{屏幕: MyScreen,}
我的StackNavigation代码在这里
import React from 'react';
import {View, Text } from 'react-native';
import Register from './Register';
import Main from
我正在尝试构建一个React,但是对于React/RN生态系统来说还是有点陌生,所以我可能只是误解了我所遇到的问题。
我有一个应用程序,其中很多页面的结构如下:
<View>
<NavComponent />
<View>
{/* Page component structure/logic here */}
</View>
</View>
NavComponent加载带有TouchableOpacity元素的可切换导航菜单,如下所示:
Go to Screen #1
Go to Screen
不确定发生了什么,但我的react导航并不是针对react本机的。
我已经安装了npm反应-导航-堆栈和npm安装-保存反应-本机-手势-处理程序反应-本机-恢复反应-本机-屏幕。
它给了我这个错误
Unable to resolve module 'react-navigation-stack' from 'routes/homeStack.js': react-navigation-stack could not be found within the project or these directories: ../node_modules
我的路径文件夹