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

let the route decide if the navigation bar is shown or not #19

Conversation

despairblue
Copy link
Contributor

fixes #6

Or rather works around facebook/react-native#3754 by vendoring NavigatorNavigationBar.

@ide
Copy link
Member

ide commented Oct 29, 2015

I don't totally understand what this PR does but I want ExNavigator to be much more general and maintainable. Specifically, a big file like the NavigationBar shouldn't be vendors if we can help it, and we especially shouldn't modify it. We don't have the bandwidth to take on the maintenance cost -- the renderNavigationBar prop exists so people can provide their own navigation bars.

@despairblue
Copy link
Contributor Author

Agreed. My problem was that I had to modify NavigatorNavigationBar, since wrapping it breaks it. Haven't thought about bundling it with my app and supplying it via the renderNavigationBar prop. That should work perfectly.

The modified NavigatorNavigationBar could even be provided as a separate npm module, that would also solve #6.

@ide
Copy link
Member

ide commented Oct 29, 2015

We wrap the NavigationBar in one of our own products and had to define a couple of imperative public methods and forward them to a NavigationBar we had wrapped. Perhaps you'd be able to do the same.

@despairblue
Copy link
Contributor Author

Nevermind, I think, it will work after implementing updateProgress, which is called by Navigator.

Leaving the rest here in case someone else trips over this...

😕 Maybe I'm really doing something wrong and can't see the forest for the trees.

I took the Navigator example for the UIExplorer and the only things I changed were:

And as can be seen in the gif in facebook/react-native#3754, just by wrapping Navigator.NavigationBar the NavigationBar is always off by one route and only for the first render pass. This completely flabbergasts me 😟

I even stepped through the execution 'till https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/Navigator/NavigatorNavigationBar.js#L157 and as far as I can inspect the components-object, it seems to be exactly the same compared to not wrapping Navigator.NavigationBar.

I'm at a complete loss here.

@ide
Copy link
Member

ide commented Oct 29, 2015

Thanks for the follow-up! BTW if you need ExNavigator to make small modifications that let you flexibly address your use case we are happy to review those PRs and make ExNavigator more broadly useful. One way I think of it is: how can we make the best programmers more productive? and then everyone else can work on becoming the best programmers.

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

Successfully merging this pull request may close these issues.

Is there any way to hide navigation bar after initial route
2 participants