react-navigation-stack

how to navigate to a particular tab from a drawer navigator menu react native

不羁岁月 提交于 2020-04-11 17:05:12
问题 I have to navigate to a particular tab when pressed from drawer items. I searched around a lot but couldnt find anything relating to my problem i tried to follow this link of navigation actions but couldnt find out how to implement it Navigate to specific tab from Drawer Navigator. const TabNavigator = createMaterialTopTabNavigator( { Upcoming: { screen: UpcomingScreen }, Accepted: { screen: AcceptedScreen }, Ongoing: { screen: OngoingScreen }, Completed: { screen: CompletedScreen }, }, );

how to navigate to a particular tab from a drawer navigator menu react native

醉酒当歌 提交于 2020-04-11 17:05:08
问题 I have to navigate to a particular tab when pressed from drawer items. I searched around a lot but couldnt find anything relating to my problem i tried to follow this link of navigation actions but couldnt find out how to implement it Navigate to specific tab from Drawer Navigator. const TabNavigator = createMaterialTopTabNavigator( { Upcoming: { screen: UpcomingScreen }, Accepted: { screen: AcceptedScreen }, Ongoing: { screen: OngoingScreen }, Completed: { screen: CompletedScreen }, }, );

How can I create or delete tabs in React Navigation based on the data fetched from API?

心已入冬 提交于 2020-01-06 04:37:04
问题 Let's say there is a tab view which has tabs with names Breads, Pizzas, Beverages, Desserts, Shakes. And the name of these tabs are fetched from API. Also, the information for each tab to show on their respective screens is fetched from the API too. Now, when one of the Tab's data gets deleted from the API. I want it to be removed from the Tab View too. How can I achieve this in React Navigation? 回答1: In react navigation we cannot have dynamic tab, as we have to define all the routes

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(

navigation.navigate is not a function

一曲冷凌霜 提交于 2019-12-24 11:27:44
问题 I'm using navigation to navigate my react native app and I couldn't Paypass this issue. I did as the docs but nothing works for me. The problem is I'm trying to use the navigation option to add a header and right button to navigate me to another screen, but it keeps giving me this error: "navigation.navigate is not a function. (in navigation.navigate is undefined) Here is my code: static navigationOptions = (navigation) => { return { title: 'Review Jobs', headerRight: (<Title onPress={()=>

How to go to initialRoute with react-navigation when exiting a child stack navigator inside a drawer?

早过忘川 提交于 2019-12-23 22:07:55
问题 I build an app with react-native, expo and react-navigation. I have a main drawer navigator who has in it 2 other stack navigator. One stack navigator have 2 pages; Products and Product. When I click on one product in the Products page, it goes into the Product page. Ben if I click on another link in my drawer navigator, I would like that the Products page's stack navigator would return to it's initialRoute when leaving the stack navigator. I tried to set the initialState for when I exit the

withNavigation can only be used on a view hierarchy of a navigator

雨燕双飞 提交于 2019-12-22 04:49:12
问题 I'm getting the error: Invariant Violation: withNavigation can only be used on a view hierarchy of a navigator. The wrapped component is unable to get access to navigation from props or context I don't know why, because I'm using withNavigation in other components in my app and it works. I don't see a difference in the components that it works on to the one that causes the error. Code: the component: const mapStateToProps = (state: State): Object => ({ alertModal: state.formControls

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

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