react-navigation

React-Navigation with Login Screen

感情迁移 提交于 2019-11-26 23:44:22
I am trying to use react-navigation to create a initial LOGIN screen which has no tabbar and header, and once the user has been successfully authenticated will navigate to another screen called LISTRECORD which has a tabbar, header and no back button option. Anyone has experience in this and can share? In summary, what i m trying to achieve with react-navigation is described below... Screen 1: Login Screen (No Header & Tabbar) Authenticated... Screen 2: LISTRECORD (Header, Tabbar and No Back Button) The tabbar contains other tabs too for navigation to Screen 3, Screen 4... agm1984 Oct 2017 I

Pass props from child to parent react navigation

孤者浪人 提交于 2019-11-26 21:03:34
I am using react-navigation . I am passing props from a react-native component to the modal from react-navigation which is opened on a tap. export default class SomeComp extends Component { ... render() { const { navigate } = this.props; return ( <TouchableOpacity onPress={navigate("Modal", {data: ..., ...})} ..../> ) } } Inside the modal I access the goBack() function which closes the modal , as well as the props passed through SomeComp export default class Modal extends Component { ... render() { const { data, ... } = this.props.navigation.state.params; const { goBack } = this.props

React Navigation: Swipe on drawer does not work in Android

心已入冬 提交于 2019-11-26 19:27:28
问题 I have been searching for a solution for a long time, but surprisingly, I think nobody has faced it yet. So I am posting it. I have created a simple Drawer Navigator with React Navigation V3. I have added a Menu icon, and when I click it, the drawer appears as it should be. But, no hand gesture is working. Swiping from left to right don't do anything. Even when the drawer is open, tapping on empty space doesn't close the drawer. Here is my code: import { createStackNavigator,

undefined is not an object (evaluating 'RNGestureHandlerModule.State'

大兔子大兔子 提交于 2019-11-26 18:07:31
问题 I have installed react-navigation in my React Native project . Its a starter project doesn't have any codes. But while running project I am facing error like this. Here is my Navigation code import { createStackNavigator } from 'react-navigation'; import Home from './screens/Home'; import WeatherDetail from './screens/WeatherDetail'; const Navigation = createStackNavigator({ Home: { screen: Home }, WeatherDetail: { screen: WeatherDetail } }); export default Navigation; And here is the App.js

StackNavigator through Component gives undefined error

筅森魡賤 提交于 2019-11-26 16:49:32
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 it anywhere. Here's my code: import React from 'react'; import { AppRegistry, Text, View, Button }

React-Navigation with Login Screen

心不动则不痛 提交于 2019-11-26 08:46:30
问题 I am trying to use react-navigation to create a initial LOGIN screen which has no tabbar and header, and once the user has been successfully authenticated will navigate to another screen called LISTRECORD which has a tabbar, header and no back button option. Anyone has experience in this and can share? In summary, what i m trying to achieve with react-navigation is described below... Screen 1: Login Screen (No Header & Tabbar) Authenticated... Screen 2: LISTRECORD (Header, Tabbar and No Back

Pass props from child to parent react navigation

谁都会走 提交于 2019-11-26 07:49:47
问题 I am using react-navigation . I am passing props from a react-native component to the modal from react-navigation which is opened on a tap. export default class SomeComp extends Component { ... render() { const { navigate } = this.props; return ( <TouchableOpacity onPress={navigate(\"Modal\", {data: ..., ...})} ..../> ) } } Inside the modal I access the goBack() function which closes the modal , as well as the props passed through SomeComp export default class Modal extends Component { ...

How to reset TabNavigator when user logs out (from other screen)

只愿长相守 提交于 2019-11-26 07:43:15
问题 Here is my project file hierarchy RootTabNavigator | AuthStackNavigator // I want to go back to this navigator | AuthoScreen | Welcome Screen | MainTabNavigator // I want to reset MainTabNavigator | FeedStacknavigator | Screen A | OtherStackNavigatorOne | Screen E | OtherStackNavigatorTwo | Screen D | MenuStackNavigator | Menuo <-I\'m here and want to reset to \'MainTabNavigator\' and go BACK to \'AuthScreen\' | Screen B | Screen C Problem The user is on Menuo Screen under MenuStackNavigator