DickyT / react-native-tabbar-navigator

(aka React Native Tanner Navigator) A component which builds excellent Navigator + TabBar based application, have a good solution for implementing hidesBottomBarWhenPushed in iOS.
97 stars 29 forks source link

Updating the NavBar items #11

Closed rahuljiresal closed 7 years ago

rahuljiresal commented 8 years ago

Many times, I wanted to update the NavBar items upon some action in the underlying component. I tried everything, but Navigator.NavigationBar did not let me update.

Also, with React Native 0.15, the ability to have an action on title of a pushed route is not possible. This is due to a bug in RN15.

Probably using https://github.com/react-native-fellowship/react-native-navbar instead of Navigator.NavigationBar is a better option.

DickyT commented 8 years ago

I just take a look on this project, does this react-native-navbar support the push operation?

DickyT commented 8 years ago

because I did not see anything about this, I think it is just a pure navigation bar?

rahuljiresal commented 8 years ago

It is just a pure navigation bar. But you can add it as a sub-component to the component that is being pushed to the navigation stack. The good thing about it is, it gets re-rendered whenever you want.

marketman400 commented 8 years ago

I've been able to update my NavBar using a function that calls forceReRender():

enableNextLink() { this.props.navComponent.forceReRender( this.props.navComponent.setNavItems({ ...

DickyT commented 8 years ago

@rahuljiresal @marketman400 does it supports animations while you are swiping back?

marketman400 commented 8 years ago

@DickyT I have not tried animations yet.

rahuljiresal commented 8 years ago

@dickyt it totally supports it. The views are still pushed using the Navigator. It just doesn't use Navigator.NavigationBar. Navigator has swipe animations out of the box, doesn't depend on the NavigationBar.

Check out my other project https://github.com/rahuljiresal/react-native-rj-navigator

DickyT commented 8 years ago

I worked it out, and I can release a new version after bugs are fixed.

DickyT commented 7 years ago

@rahuljiresal latest version fixed