react-navigation

Implementation detail worries - Calling navigate on nested Navigator

吃可爱长大的小学妹 提交于 2019-12-11 05:16:12
问题 In summary - my question is, is there an alternative way to acheive this sidebar tabs, possibly/hopefully with TabNavigator? Or is my approach below not a implemenation detail and future-proof? I am trying to create a tab navigator with tabs on side. I could not pull this off with TabNavigator so I I nested a StackNavigator with the following structure: class PageShowroom extends React.Component { childnav = {} navRef = el => this.childnav.navigate = el && el._navigation.navigate

TabNavigator pass different param from each screen to StackNavigator header

偶尔善良 提交于 2019-12-11 05:05:46
问题 I have Question. How can I pass specific param from each screen to the StackNavigator header in order to come out different kind of components when reached the screen. I have done some research about this kind of question, but there are not much info that can help me. So I posted here to find some help, hope there are someone who can guide me. Thanks a lot. const mainNav = TabNavigator({ Home: { screen: HomeScreen, param:{ tabval:1 } }, Live: { screen: LiveScreen, param:{ tabval:2 } }, Radio:

react-navigation: have the same state as a previous route, but act as a push?

♀尐吖头ヾ 提交于 2019-12-11 04:53:30
问题 Say I have Screen 1 and Screen 2 . I navigate from Screen 1 to Screen 2 by pushing. So Screen 1 is still there, and its state is unchanged. But, I want to be able to navigate to a third screen, Screen 3 , that has EXACTLY the same state as Screen 1 (a copy), but acts like a push . Pushing from Screen 1 to Screen 2 gives me a card transition, but I basically want to push from Screen 2 to Screen 3 (another card transition), but have Screen 3 to have the same state as Screen 1 , like scrolling

DrawerNavigator inside StackNavigator using react-navigation

不想你离开。 提交于 2019-12-11 04:44:44
问题 I am trying to replicate the below design but I cannot find much information on how to implement DrawerNavigator for a specific screen and hook it up with redux. DrawerNavigator to be independent of the routes. All I want is a profile pic, name of the user, log out button and app version 回答1: I assume that your app is going to have 2 main navigators which are for authentication and main navigator. If you use react-navigation , you may want to wrap DrawerNavigator inside the StackNavigator ,

react-navigation slows while debugging remotely after updating React-native

两盒软妹~` 提交于 2019-12-11 04:28:55
问题 I am developping an react-native mobile application which will be mainly used in android platform. I recently needed to upgrade react native version for react-native-firebase. React-native version was 0.57.2 . I upgraded onto 0.59.6 using rn-diff-purge. While doing so, I needed to update react-navigation version from 2.17.0 to 3.8.1 (but type version is @types/react-navigation": "^2.0.23" as you can see, I don't know if that makes a difference) After upgrading, only headache was again react

[[ERROR]] undefined is not an object(evaluating '_this2.props.navigation.push')

这一生的挚爱 提交于 2019-12-11 02:35:05
问题 Guys I'm with this problem and I can't solve it, I try many things but this error apears to me. So I'm lost, please help me this in the main ( Route) : App.js const Router = createStackNavigator( { Login: {screen: LoginScreen}, Julia: {screen: JuliaScreen}, }, { initialRouteName: 'Login', headerMode: 'none', } ) LoginScreen.js --> The Login Screen <View style = {styles.formContainer}> <LoginForm/> </View> LoginForm.js --> Component of Login ( Login Form ) import React, { Component } from

Finding a TabNavigator tab item with detox in React Native

血红的双手。 提交于 2019-12-11 02:32:45
问题 I'm using react-navigation in my React Native project that I'm setting up automated testing for using Detox. Unfortunately, I don't see anything in the docs about how to tell detox to find (and then of course tap) the Tab of a Tab Navigator. I tried looking through component tree using react-devtools, but couldn't figure out which element represented the tab button itself. I also tried finding the element by it's text like so: await element(by.text('My Tab Button')).tap(); but that through a

Android OS back button takes me back to Expo projects screen

﹥>﹥吖頭↗ 提交于 2019-12-11 01:36:08
问题 Firstly, I have a React Native app built using Expo and utilising React Navigation for routing. I'm using a SwitchNavigator to switch between two stack navigators which represent my authorisation workflow (my screens before I've logged in) and my app workflow (the screens after I've logged in) and it looks something like this. const AppStack = createStackNavigator({ Home: HomeScreen, Second: SecondScreen, HouseDetail: HouseDetailScreen, Camera: CameraScreen} ); const AuthStack =

How to navigate from custom navigator to createBottomTabNavigator in React Native?

牧云@^-^@ 提交于 2019-12-10 23:45:13
问题 I've a custom navigator because I wanted to go back to the previous screen using a back swipe gesture. Below is the code of the main file from where the navigators are called. const MainSwipeStack = () => { return( <Navigator> <Route name="LoggedOutHome" component={LoggedOutHome} /> <Route name="SignUp" component={SignUp} /> <Route name="SignupUsername" component={SignupUsername} /> <Route name="Login" component={Login} /> </Navigator> ); } export default createSwitchNavigator({ SwipeStack:

Passing props to Custom Drawer Navigator in React Navigation

戏子无情 提交于 2019-12-10 18:54:27
问题 In react navigation drawermenu. I want to display the username 'John Doe' which is in the state of my main component 'Router' How can I pass it the CustomDrawerContentComponent. Extra Info: I'm getting this name from AsyncStorage in componentDidMount This is my code export default class Router extends Component { constructor(props) { super(props); this.state = { employeeName: "John Doe" //<-----How to pass this name to CustomDrawerContentComponent???? }; } render() { return <MyApp />; } }