This is a deeper answer based on this issue in React-Native.
In the left sidebar of Xcode, select “Project Manger” (folder icon) to see the file structure.
The specific folder you are looking for is located at: [YourAppName]> Libraries> React.xcodeproj> React> Views
RCTNavItem.h
#import "RCTComponent.h" @interface RCTNavItem : UIView
RCTNavItemManager.m
@implementation RCTNavItemManager RCT_EXPORT_MODULE() - (UIView *)view { return [RCTNavItem new]; }
RCTNavigator.m
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(__unused UIViewController *)viewController animated:(__unused BOOL)animated {
I did not need to add propTypes to NavigatorIOS.ios.js or TabBarIOS.ios.js
For all this to work, each tab seems to have its own NavigatorIOS component. When I just had a screen in my tab, the method - (void) navigationController: (UINavigationController *) navigationController ... was not called. This is not a problem for me, because hiding navBar is easily done using navigationBarHidden: true.
In my case, I had TabNav> HomeNav> HomeScreen
Passing showTabBar to HomeNav:
render() { return ( <NavigatorIOS style={styles.container} client={this.props.client} initialRoute={{ title: 'Home', component: HomeScreen, navigationBarHidden: true, showTabBar: false, passProps: { ...}, }}/> ); } }
Hope this helps someone!
source share