stack-navigator

Unable to resolve “@react-navigation/native” from “App.js” - React Native + How to Solve?

时光怂恿深爱的人放手 提交于 2020-08-02 12:24:21
问题 undefined Unable to resolve module @react-navigation/native from App.js : @react-navigation/native could not be found within the project. If you are sure the module exists, try these steps: 1. Clear watchman watches: watchman watch-del-all 2. Delete node_modules: rm -rf node_modules and run yarn install 3. Reset Metro's cache: yarn start --reset-cache 4. Remove the cache: rm -rf /tmp/metro-* - node_modules\react-native\Libraries\Utilities\HMRClient.js:307:41 in showCompileError - node_modules

React Native - Android - keyboardavoidingView in stackNavigator within a tabNavigator pushes bottomTabBar (clunky behaviour)

≡放荡痞女 提交于 2020-06-17 09:37:08
问题 I am trying to build an auth flow that has a welcome page and then login or signup depending on the user's case. It is built inside a stack navigator. The first screen has no header but then login and signup do via their screen options. // AuthNavigator const AuthStackNavigator = createStackNavigator(); export const AuthNavigator = () => { return ( <AuthStackNavigator.Navigator initialRouteName={WELCOME_PAGE.id} screenOptions={{ headerShown: false, headerTintColor: colors.primary, }} lazy>

Hide TabBar item in TabNavigator

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-28 04:15:05
问题 How is it possible to hide certain TabBar item from TabNavigator. Is there a certain TabBarOptions option, which has visible key(true/false) like this? const Tabs = TabNavigator({ Home: { screen: Home }, Profile: { screen: Thanks, tabBarOptions: { visible: false }, }, More: { screen: More }, }) 回答1: There is not 'visible' option for hide specific item from TabNavigator. You need to create a Stacknavigator and a Tabnavigator. In the Stacknavigator you will add yours 'invisible' tabbar items

How do I pass navigation props from parent component to header?

自作多情 提交于 2020-04-10 06:22:31
问题 I have 4 pages: App.js, HomeScreen.js, Login.js, Toolbar.js My App page with the StackNavigator: import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View } from 'react-native'; import { StackNavigator, DrawerNavigator } from 'react-navigation'; import Splash from './screens/Splash'; import HomeScreen from './screens/HomeScreen'; import Login from './screens/Login'; import Lobby from './screens/Lobby'; import Wifi from './screens/Wifi'; import Toolbar from '.

getting undefined is not a function (evaluating '(0,_reactNavigation.stacknavigator)') in drawer navigation

心不动则不痛 提交于 2020-01-31 21:12:13
问题 In my application I need drawer navigation, for that I am using sample code from this. I have integrated everything in my application, but getting the following error undefined is not a function (evaluating '(0,_reactNavigation.stacknavigator)') And installed this one too. npm install react-navigation --save But don't know why this error is coming, So please guide me how to resolve this. This is my app.js import React, { Component } from 'react'; import { StyleSheet , Platform , View , Text ,

How to change back button route in react navigation

☆樱花仙子☆ 提交于 2020-01-02 07:02:13
问题 i am using react-navigation (stack-navigation). i want to change my header back button icon route. Home BookTicket MyBookings these are the screens i have in my project.Now when i click header back button in MyBookings screen it should route to Home Screen. 回答1: There must be back button in default if your stackNavigator stack is properly configured. But if you would like to replace the default button just add headerLeft and pass your custom component Screen Navigation Options in the page you

TabBar inSide the StackNavigation in React Native

一曲冷凌霜 提交于 2019-12-24 22:06:09
问题 I will take StackNavigation for Push and Pop with its parameter. Its Working fine. But Now I want to implement after some screen TabBar after StackNavigation, Have any Idea How to Take TabBar after StackNavigation. Note : I want to implement Custom TabBar. Please help me. 回答1: You can do something like let StackWithTabs1 = StackNavigator({ // stackNavigator inside the tabNavigator Screen3:{ screen: Screen3 } ,Screen4:{ screen: Screen4 } }); let StackWithTabs2 = StackNavigator({ //

Nesting multiple navigators

拟墨画扇 提交于 2019-12-24 18:41:08
问题 I'm trying to integrate StackNavigator, TabNavigator and DrawerNavigator like this: class TestApp extends Component { render() { return ( <MyApp /> ); } } const Tabs = TabNavigator({ Home1: { screen:Home1 }, Home2: { screen:Home2 }, }, { tabBarPosition: 'bottom', }); const Drawer = DrawerNavigator({ First:{ screen: DrawerScreen1 }, Second:{ screen: DrawerScreen2 } },{ initialRouteName:'First', drawerPosition: 'left' }); const MyApp = StackNavigator({ Screen1: {screen:Screen1}, Screen2:

React Native - Passing Data Across Screens

别说谁变了你拦得住时间么 提交于 2019-12-22 05:05:12
问题 I'm having some trouble with a react-native app. I can't figure out how to pass data across screens. I realize that there are other similar questions that are answered on SO, however the solutions did not work for me. I'm using the StackNavigator . Here's my setup in my App.js file. export default SimpleApp = StackNavigator({ Home: { screen: HomeScreen }, Categories: { screen: CategoriesScreen }, // send from here Category: { screen: CategoryScreen } // to here }); I have a TouchableHighlight

StackNavigator through Component gives undefined error

纵饮孤独 提交于 2019-12-17 03:44:30
问题 I was trying to use StackNavigator for navigation and it works when I use it to go from one screen to the other as explained here. But when I try to have a subcomponent to navigate through itself, the navigation doesn't seem to work and I couldn't find any solution to it. As given in the code below, I'm trying to use the Test Component in which there is a button that can be clicked to move from HomeScreen to ChatScreen. I'm pretty sure the solution is something basic, but I really can't find