react-navigation

undefined is not an object (evaluating route.routeName)

邮差的信 提交于 2019-12-03 03:59:44
when update the expo from (16.0.0) to (24.0.0) and react navigation from (git+ https://github.com/react-community/react-navigation.git ) to (^1.0.0-beta.21) version, this error occured Finally found out how to solve this, its an undocumented DrawerNavigatorConfig: drawerOpenRoute: 'DrawerOpen', drawerCloseRoute: 'DrawerClose', drawerToggleRoute: 'DrawerToggle' Look here: https://github.com/react-community/react-navigation/issues/3148#issuecomment-352778884 remove ^ from package json before react-nativetion package it should be look like this "react-navigation": "1.0.0-beta.20" not "react

React Native, change React Navigation header styling

橙三吉。 提交于 2019-12-03 03:05:15
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 = { title: 'Welcome', }; render() { return ( <View style={styles.container}> <Text style={styles.welcome}>

Show splash screen before show main screen in react native without using 3rd party library

陌路散爱 提交于 2019-12-02 17:44:52
I am beginner in react native so may be my question seems silly to all experts. but I am struggling with a basic feature that i want to implement that i want to start my app with splash screen and after few seconds i want to show login screen or main screen. I checked some example but did not found any example with full code so don't know how to use those code snippets in my app. I've tried to apply some code as per documentation but my code is giving error, please have a look and help me. Below is my code: Index.android.js /** * Sample React Native App * https://github.com/facebook/react

How to reset a specific stack navigator from outside of it?

时光怂恿深爱的人放手 提交于 2019-12-02 16:19:39
问题 I'm making an app using react-navigation with react-native. The structure of my app is, Main Tab - Tab 1 (Stack) - screen A - screen B - screen C - Tab 2 (Stack) - screen D - screen E - screen F What I want to do is reset Tab 1 (Stack Navigator) at the specific time and do not navigate to Tab 1. if a user is located in screen F, I just want to reset Tab 1 (Stack) without letting the user move to Tab 1. So I think dispatching navigation actions should be triggered outside of these react

React Navigation vs. React Native Navigation [closed]

走远了吗. 提交于 2019-12-02 15:21:35
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 React Native Navigation as the name says uses the native modules with a JS bridge, so performance will/may be better. requires native integration. While React Navigation is a simple and powerful solution provided by react native itself. Its an all JS implementation unlike the other that uses native support which can be tricky. Just npm-install and you're good to go ... Use react

Add Custom createMaterialTopTabNavigator to component?

人盡茶涼 提交于 2019-12-02 10:35:53
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 "./Reviews"; const NavTabs = createMaterialTopTabNavigator( { About: { screen: AboutScreen }, Galaty: {

How to reset a specific stack navigator from outside of it?

我怕爱的太早我们不能终老 提交于 2019-12-02 10:07:25
I'm making an app using react-navigation with react-native. The structure of my app is, Main Tab - Tab 1 (Stack) - screen A - screen B - screen C - Tab 2 (Stack) - screen D - screen E - screen F What I want to do is reset Tab 1 (Stack Navigator) at the specific time and do not navigate to Tab 1. if a user is located in screen F, I just want to reset Tab 1 (Stack) without letting the user move to Tab 1. So I think dispatching navigation actions should be triggered outside of these react components, somewhere like resetHelper.js But I can't figure out how to reset a specific stack without

react-navigation is failing to bundle when using with webpack

妖精的绣舞 提交于 2019-12-02 07:24:24
问题 We are getting this error while bundling through web pack ERROR in ./node_modules/react-navigation-stack/lib/module/views/StackView/StackViewLayout.js Module not found: Error: Can't resolve 'react-native-screens' in 'C:\Users\gowthaman.s\Desktop\WebPack Testing\SampleButton\node_modules\react-navigation-stack\lib\module\views\StackView' @ ./node_modules/react-navigation-stack/lib/module/views/StackView/StackViewLayout.js 1:1712-1762 1:10662-10677 @ ./node_modules/react-navigation-stack/lib

Conditional React Navigation header button

家住魔仙堡 提交于 2019-12-02 06:34:48
I am trying to make a button appear in headerRight of the header bar in a React Navigation screen, but I cant seem to get it to work. I want the start button (what is in headerRight ) to show when props.players.length > 1 . Can anyone point me in the right direction? You can use the same mechanics describe here for title: https://reactnavigation.org/docs/en/headers.html#setting-the-header-title Set a navigation params and use it on your navigationOptions. In your case: state = { players: 0 }; static navigationOptions = ({ navigation }) => { return { headerRight: navigation.getParam('players',

How do I force a component to unmount when I navigate to a new page in react native?

萝らか妹 提交于 2019-12-02 05:48:26
问题 I want to make sure the lifecycle method ComponentWillUnmount fires when I navigate to a new page. I found this post, but that doesn't seem to mention anything about navigating to a new page. I also found this post but I'm using react-navigation. In addition, I'm not using pop/push. I'm simply using this.props.navigation.navigate('SomePage') to get to the next page 回答1: You can use this.props.navigation.replace('routName'); It will do your job. 回答2: Checkout React Navigation 's ways to handle