react-navigation

Use 'navigation' and 'route' inside header present in class - React-navigation v5

你。 提交于 2020-04-10 05:31:43
问题 I'm stuck as I want to switch to the V5 version of react-navigation. With v4, I used to pass my params and use them with : Set : this.props.navigation.navigate('MyDestination', {myParam: 'value'}) Get : this.props.navigation.getParam('myParam') With v5, some things changed and I now can't use the this.props.navigation since it's not seemed to be known by the app. My code is splitted so I have my App.js that only refer to the Navigation class : import React from 'react'; import { StyleSheet,

How to remove reach navigation 5.x warnings

此生再无相见时 提交于 2020-04-10 04:08:53
问题 I am developing a mobile app using react native Expo. I used the React Navigation version 5.x and getting the following warnings: web Compiled with warnings. D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'DrawerActionType' is not exported from './DrawerRouter'. D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'DrawerNavigationState' is not exported from './DrawerRouter'. D:/_expo/navi/node

How to remove reach navigation 5.x warnings

狂风中的少年 提交于 2020-04-10 04:07:02
问题 I am developing a mobile app using react native Expo. I used the React Navigation version 5.x and getting the following warnings: web Compiled with warnings. D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'DrawerActionType' is not exported from './DrawerRouter'. D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'DrawerNavigationState' is not exported from './DrawerRouter'. D:/_expo/navi/node

How to hide Tab conditionally in react-navigation?

筅森魡賤 提交于 2020-03-26 04:08:07
问题 I want to hide one of my tabs conditionally if user login, So I have 5 Tabs If user login\register I get a boolean from a redux store, if this user login i want to how a "Library tab" if not login, i don't want to show this tab "Library" with others and just keep 4 tabs in the App Code import {createAppContainer} from 'react-navigation'; import {createBottomTabNavigator} from 'react-navigation-tabs'; let {isLogin} = store.getState().user; const TabHome = createBottomTabNavigator( { Home: {

React Navigation V5 Hide Bottom Tabs

假装没事ソ 提交于 2020-03-25 13:59:53
问题 I would like to be able to hide the tabs on a screen using React Native Navigation v5. I've been reading the documentation but it doesn't seem like they've updated this for v5 and it refers to the < v4 way of doing things. here is my code: import Home from './components/Home'; import SettingsScreen from './components/Settings'; import * as React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs

React Navigation V5 Hide Bottom Tabs

霸气de小男生 提交于 2020-03-25 13:57:41
问题 I would like to be able to hide the tabs on a screen using React Native Navigation v5. I've been reading the documentation but it doesn't seem like they've updated this for v5 and it refers to the < v4 way of doing things. here is my code: import Home from './components/Home'; import SettingsScreen from './components/Settings'; import * as React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs

React Navigation V5 Hide Bottom Tabs

百般思念 提交于 2020-03-25 13:56:10
问题 I would like to be able to hide the tabs on a screen using React Native Navigation v5. I've been reading the documentation but it doesn't seem like they've updated this for v5 and it refers to the < v4 way of doing things. here is my code: import Home from './components/Home'; import SettingsScreen from './components/Settings'; import * as React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs

React Native - ReactNavigation.addNavigationHelpers in not a function

Deadly 提交于 2020-03-18 10:56:07
问题 I was using react-navigation 1.2.1 and every thing was working fine as soon as I updated react-navigation to 2.0.0 it gives the following error. Any idea why it must be happening? ReactNavigation.addNavigationHelpers in not a function. import * as ReactNavigation from 'react-navigation'; render() { const { dispatch, nav } = this.props; const navigation = ReactNavigation.addNavigationHelpers({ dispatch, state: nav, addListener, }); return <AppNavigation navigation={navigation} />; } //"react

How do I highlight the current tab using a custom drawer navigator in React Native

对着背影说爱祢 提交于 2020-03-05 04:42:07
问题 Using a custom drawer navigator in React Native, how do I highlight the current screen name? Is there a prop that is supposed to be passed? For example in the image, I am on the "Home" screen. How do I know the screen I am on to change the text colour of home, for example. 来源: https://stackoverflow.com/questions/51349440/how-do-i-highlight-the-current-tab-using-a-custom-drawer-navigator-in-react-nati

Position Drawer element at the bottom of the menu

雨燕双飞 提交于 2020-03-05 04:32:06
问题 how is it possible to position the menu point at the lower edge of the screen? The best solution would be if you could simply change the style of the navigation options for each element. Here is my App Navigator: const AppNavigator = createDrawerNavigator( { Einkaufsliste: { screen: MainScreen, navigationOptions: { drawerIcon: <Icon name="shopping-cart" /> } }, Bearbeiten: { screen: BasketEditScreen, navigationOptions: { drawerIcon: <Icon name="edit" /> } } }, { contentComponent: