我正在尝试使用react导航来实现堆栈导航。当我创建一个堆栈导航const并在我的默认屏幕中调用时,它给了我这个错误。
路由'Main‘应该声明一个屏幕。例如:从‘./ MyScreen’导入MyScreen;主页:{屏幕: MyScreen,}
我的StackNavigation代码在这里
import React from 'react';
import {View, Text } from 'react-native';
import Register from './Register';
import Main from
我想要一个飞溅的屏幕和一个主屏幕,里面有抽屉。我在这里面临一些问题。下面是我的堆栈导航器。
import React from 'react';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import SplashScreen from '../Screens/SplashScreen';
import HomeScreen from '../Screens/HomeScreen';
import DrawerNavigat
我在StackNavigator中声明了两个屏幕A和B。StackNavigator嵌套在tabNavigator中。该条在两个屏幕上都可见。我只想在屏幕A中显示它。我在屏幕B中将tabBarVisible设置为false,但没有效果。
import React,{Component} from 'react';
import {Text} from 'react-native';
import {StackNavigator, TabNavigator} from 'react-navigation';
class ScreenA
我见过很多人都有这个问题,但没有人的答案为我解决了这个错误。我得到的错误是:
undefined is not an object react native evaluating this.props.navigation Here is a picture https://imgur.com/a/JP9RLZT
我的目标是创建一个登录屏幕,该屏幕指向一个带有选项卡栏的主屏幕。工具栏可以工作,但由于上面的错误,我不知道如何使登录屏幕打开到该屏幕。
我的适用文件代码如下所示:
app.js
import React from 'react';
import { StyleSh
我正在使用create-react-native-app、react-navigation和react-redux创建一个react本地应用程序。我正在尝试将一个redux连接的组件作为一个屏幕添加到嵌套的StackNavigator中(尽管嵌套似乎没有什么区别,但两者都不起作用),并且一直收到一条错误消息,上面写着Route 'MilkStash' should declare a screen。当我从MilkStash.js文件中删除redux连接时,一切正常。知道该怎么做吗?
App.js
import React, { Component } from 'rea
打开应用程序时显示错误。
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in.
这是我创建的基本代码。请参阅复制步骤:
使用命令create-react-native-app Aw