Navigation.events().registerBottomTabSelectedListener(someFunc) does not fire someFunc when tabs are changed. My code is below (I am using Typescript. But that should have no effect on this discussion):
constructor(props: any) {
super(props);
this.eventSubscription = Navigation.events().registerBottomTabSelectedListener(this.tabChanged);
}
tabChanged = (info: { selectedTabIndex: number, unselectedTabIndex: number }) => {
this.props.onBottomTabChanged(info.selectedTabIndex);
}
componentWillUnmount() {
this.eventSubscription.remove();
super.componentWillUnmount();
}
I think I may have solved the issue. But i am not sure:
Added "self.delegate = self;" in function initWithLayoutInfo in RNNTabBarController.m
@rishabhpoddar this is correct.
@jcsena cheers!
Fixed fee53a1a914bceb2980a5f682d57ed267257c480
Thanks
Most helpful comment
I think I may have solved the issue. But i am not sure:
Added "self.delegate = self;" in function initWithLayoutInfo in RNNTabBarController.m