react-navigation

React Navigation how to hide tabbar from inside stack navigation

折月煮酒 提交于 2019-12-31 17:19:13
问题 I have the following stack navigation and screens: export const HomeStack = createStackNavigator({ Home: HomeScreen, Categories: CategoriesScreen, Products: ProductsScreen, ProductDetails: ProductDetailsScreen, }) I want to hide tabs only in ProductDetailsScreen export const hideTabBarComponents = [ 'ProductDetails', ] export const MainTabs = createBottomTabNavigator( { Home: HomeStack, Favorite: FavoriteScreen, Account: AccountScreen, Help: HelpScreen, Events: EventsScreen }, {

React Native, change React Navigation header styling

孤街浪徒 提交于 2019-12-31 12:52:59
问题 I'm implementing React Navigation in my React Native app, and I'm wanting to change the background and foreground colors of the header. I have the following: /** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; import { StackNavigator } from 'react-navigation'; export default class ReactNativePlayground extends Component { static navigationOptions = {

React Navigation vs. React Native Navigation [closed]

孤者浪人 提交于 2019-12-31 08:12:00
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 months ago . I just want to know honest, experienced and objetive points of view about these two soutions to implement the navigation in React Native: React Navigation React Native Navigation Which is better and why. Thanks 回答1: React Native Navigation as the name says uses the native

React Navigation vs. React Native Navigation [closed]

梦想与她 提交于 2019-12-31 08:11:09
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 months ago . I just want to know honest, experienced and objetive points of view about these two soutions to implement the navigation in React Native: React Navigation React Native Navigation Which is better and why. Thanks 回答1: React Native Navigation as the name says uses the native

Add Custom createMaterialTopTabNavigator to component?

我只是一个虾纸丫 提交于 2019-12-31 07:06:09
问题 I have an issue with createMaterialTopTabNavigator, I'm already declaring an AppContainer in my Route.js File, the error goes away if create a separate AppContainer for a TobTab in a screen I want to add these Tob Tabs in like this const Root = createAppContainer(NavTabs); so I made a specific file contained a Tabs "NavTabs.js" import { createMaterialTopTabNavigator } from "react-navigation"; import AboutScreen from "./About"; import GalaryScreen from "./Galary"; import ReviewsScreen from ".

React Navigation check if previous screen exists

匆匆过客 提交于 2019-12-30 07:05:08
问题 I am looking desperately for a possibility to check if a previous screen exists in ReactNavigation. Using this.props.navigation.goBack() returns false if no previous route exists, but I can not use it because if a previous route exists I get redirected. Is there a possibility to check if I opened the app instead of navigated from another screen to the Home screen? Thank you. I am not using Redux. It would make such stuff easier but I would like to avoid using it at the moment. 回答1: What could

How to set navigationOptions on stateless component with Typescript

我们两清 提交于 2019-12-30 04:04:12
问题 I have a react component like const Example = () => (<View>...</View>); Using react-navigation I would normally apply navigation options by saying Example.navigationOptions = { options }; With typescript I am getting the error [ts] Property 'navigationOptions' does not exist on type '(props: Props) => Element'. How can I fix this? I tried writing an interface interface ExampleWithNavigationOptions extends Element { navigationOptions?; } But with no luck. 回答1: The key idea is to specify

Is there an onPress for TabNavigator tab in react-navigation?

落花浮王杯 提交于 2019-12-25 16:09:20
问题 I am trying to have a DrawerNavigator when user taps on the last tab(for example 'More') in TabNavigator. How is this possible to achieve it without having a screen for that tab and then calling the DrawerNavigator in componentWillMount. componentWillMount() { this.props.navigation.navigate("DrawerOpen") } It is kind of a hack which is not proper solution I think(This way 'More' screen is loaded), there has to be a better solution for that. 回答1: This is also a bit of hack but I think its the

React navigation navigate without navigation props example not working

依然范特西╮ 提交于 2019-12-25 03:04:07
问题 I have a react-native app and I'm using the new Context API to manage the storage and stuff, now I'm wrapping the createAppContainer(AuthNavigator) in the <Provider> created by the context api, so in order to navigate from the Context API file, I tried to do the exact same example I found in the documentation by creating the NavigationService and passing the ref of the AppContainer to the NavigationService and using { NavigationActions } , somehow it's not working neither it's throwing any

Method is not being invoked when i press the button

蹲街弑〆低调 提交于 2019-12-25 01:44:31
问题 I am using react navigation and have added a button on the right to signout from my app using default navigation options as shown below : const otherApp = createStackNavigator({ Welcome : { screen : WelcomeScreen } }, { defaultNavigationOptions : ({navigation}) => ({ title : 'Welcome', headerStyle: { backgroundColor: '#29434e', shadowColor: 'transparent', elevation: 0 }, headerRight: ( <TouchableOpacity style={{ backgroundColor: '#DDDDDD', padding: 5 }} onPress={() => navigation.getParam(