How to hide bottom navigation bar on a specific screen in react native?

I’ve traversed the internet like never before to find a solution for this problem as the provided solution by the docs did not work in the slightest. I had the following navigational Set-Up: Bottom Tabs A (NativeStack) 1 (Screen) 2 (Screen) 3 (Screen) B (NativeStack) C (NativeStack) I wanted to hide the bottom bar in … Read more

Refresh previous screen on goBack()

Adding an Api Call in a focus callBack in the screen you’re returning to solves the issue. componentDidMount() { this.props.fetchData(); this.willFocusSubscription = this.props.navigation.addListener( ‘willFocus’, () => { this.props.fetchData(); } ); } componentWillUnmount() { this.willFocusSubscription.remove(); } UPDATE 2021: componentDidMount() { this.props.fetchData(); this.willFocusSubscription = this.props.navigation.addListener( ‘willFocus’, () => { this.props.fetchData(); } ); } componentWillUnmount() { this.willFocusSubscription(); } … Read more

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

This should work in most cases: componentWillReceiveProps(nextProps) { if ( nextProps.token == undefined || _.isNil(nextProps.token) ) { let action = NavigationActions.reset({ index: 0, key: null, actions: [ NavigationActions.navigate({routeName: ‘Auth’}) ] }); nextProps.navigation.dispatch(action); } … } Or try by enhancing your navigator with custom action: const changeAppNavigator = Navigator => { const router = Navigator.router; const … Read more