react-navigation-drawer

How to remove reach navigation 5.x warnings

狂风中的少年 提交于 2020-04-10 04:07:02
问题 I am developing a mobile app using react native Expo. I used the React Navigation version 5.x and getting the following warnings: web Compiled with warnings. D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'DrawerActionType' is not exported from './DrawerRouter'. D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'DrawerNavigationState' is not exported from './DrawerRouter'. D:/_expo/navi/node

Custom navigation operation on specific tab button of react-navigation's tab navigator

限于喜欢 提交于 2020-01-16 08:29:13
问题 I wanna open drawer (for example, options menu) from specific button on tab instead of navigating to screen. My current solution was working on react-navigation v2 but as we upgraded from v2 to v3 of react-navigation and v60 of react-native from v57, the solution has stopped working. There is a dummy screen assigned to the menu tab button in tab bar and I am intercepting the navigation operation using tabBarOnPress() . The method opens drawer and returns if it matches the menu button's route

React native set state from drawer navigator to other component

假装没事ソ 提交于 2020-01-06 03:04:08
问题 On first screen I have a component having some listing of products say ProductListing.js. And on drawer navigator I have some check boxes. I want to set state of ProductListing.js when I am clicking on any check box of navigator. App.js import React, {Component} from 'react'; import Router from './src/config/routes'; export default class App extends React.Component { render () { return ( <Router/> ); } } Router.js export default DrawerNavigator({ Dashboard: {screen: Dashboard}, CreateLogin:

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