Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navigation.setParams doesn't work property when navigate.navigate('DrawOpen') at the same time #4029

Closed
DrakeXiang opened this issue Apr 20, 2018 · 1 comment

Comments

@DrakeXiang
Copy link

DrakeXiang commented Apr 20, 2018

Current Behavior

The tabBar seems toggles every other time as I toggle the drawer

Expected Behavior

The tab bar should toggles every time correctly as I toggle the drawer

How to reproduce

Demo: https://snack.expo.io/Skpvj5P2z

Your Environment

software version
react-navigation 1.5.11
react-native 0.55.3
node 8.10.0
npm or yarn yarn 1.3.2
@brentvatne
Copy link
Member

this is a bug that falls out of the fact that we use a separate navigator for drawer routes. that said, this isn't the right way to be structuring this based on what you're trying to accomplish. if you instead do this:

import { TabNavigator, DrawerNavigator, TabBarBottom } from 'react-navigation';

import HomeScreen from './HomeScreen';


const HomeTab = TabNavigator(
  {
    Home: HomeScreen,
  },
  {
    tabBarComponent: TabBarBottom,
    tabBarPosition: 'bottom',
  }
);


const Router = DrawerNavigator(
  {
    HomeTab,
  },
);

export default Router;

then your problem will be solved, the drawer will appear above the tab bar and there is no need to hide it at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants