-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[NavigatorIOS] doesn't update when navigationBarHidden changes #846
Comments
i have sample problem with u , and when i change the tarbar, the navigationbar title can't change |
I'm also having this issue. |
Having this issue as well. Tried to follow the chain that lead to this. This method does get called on state change or on Perhaps the UIKit portion isn't setup for accepting the changes? https://github.com/facebook/react-native/blob/master/React/Views/RCTWrapperViewController.m#L69 |
Perhaps the work around for now is to setup the first page as non- |
Any more insights on this? I just reverted a lot of code since I was using the 'navigatorIOS' from the second page forward. But then I saw the |
|
@liubko I cannot get that to work. Can you show the code you use to change Here is how I do it, with no effect (btw
|
@jeroenbourgois |
@jeroenbourgois I save
so then if I do smth like this:
it works correctly. But it doesn't work when I use |
AHA but of course! Should have seen that.... thanks a bunch! |
Still not quite clear how to change isNavBarHidden from a child view .... @liubko how does this.setState is going to fix the problem as the state is at the parent level class |
@eltoob when you change state in parent component you then pass it to
this will cause a re-render with new |
@liubko are you passing the context of the parent component to the child component through the props object? |
@alexrabarts you can pass a callback which will change state in parent component Actually I ended up using my own header component, to have more control on it |
@liubko just a bit confused ... how do you change the state of the NavigatorIOS from a child component ... it doesn't inherit the state from the parent component |
@eltoob not sure if we understand each other, I made a demo: https://rnplay.org/plays/L9v2wg |
@liubko - great way to demo that 😄 |
I fixed this here: brentvatne/react-native-navigator-ios-hide-bugfix@e0655d1 If this doesn't seem like too much of a hack, I can follow along those lines and have it update other props as well. cc @ide |
@brentvatne your fix would work when I move from A(no navbar)->B(no navbar)->C(with navbar). But when I move back to B from C, B will show navbar and toggle in B won't work. Is there any way we can listen on navigator route change? This would fix the problem. |
Yeah like @shahbhavir said, this is all good for pushing new views, but does not take into account going backwards. I need view A (nav bar hidden) to push view B (with nav bar). And then be able to tap back and have the nav bar removed again. Also take into account supporting the interactive pops by dragging edge of the screen. In iOS world this is as simple as |
@brentvatne I think it is not solved! Please have a look for my demo -> https://rnplay.org/apps/o8dTnw |
It is indeed not solved. @shahbhavir has the reason why, and I agree; events for navigation route change would be a straight-forward way to solve this issue. Has anyone had any luck with a solid solution to hiding the nav bar on the home page (no matter how it's navigated to)? |
Pull request for this is welcome! Nobody is currently working on NavigatorIOS, so if you use it then you're as good a person as anyone to make it better 😄 |
+1 |
I updated to react native 0.8 and still have this problem, wish it could be fixed. |
The
Your demo here brentvatne/react-native-navigator-ios-hide-bugfix@e0655d1 works fine as long as you're pushing the view. Popping doesn't trigger an update. Now I'm not recommending that anyone do thism but setting getting rid of the sonthonaxrk@e5374d2#diff-2cc53d7b47c5b24c6942b6b1aec85b40 Perhaps we should look at the logic of how |
To hide navigationBar in any chosen view you can change one line in source code. In in
change
to
now you can
|
+1 @katrinanova, this worked for me, thank you! |
That's neat @katrinanova :) Want to submit a pull request for this? |
@brentvatne just submitted a pr :) |
For the record, @katrinanova's PR #5101 |
Anyone else still having issues? I'm still having trouble to update simple props like the navigator title by calling To test things out I tried removing the
I'll keep checking |
@pedro I am still having the same issue in 0.20. Passing navigationBarHidden in replace() or resetTo() does not work, but it does work in push(). I am hacking around this by calling: This is not quite a replacement because you still get the push transition, but I'm living with that. |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/navigatorios-doesnt-update-when-navigationbarhidden-changes ProductPains helps the community prioritize the most important issues thanks to its voting feature. Also, if this issue is a bug, please consider sending a pull request with a fix. |
On my main view, I want to hide navigation bar, but show it in the child views. I pass some props to show/hide the navbar to children, and call them accordingly in componentDidMount/ componentWillUnmount.
Showing works, but hiding doesn't work (or sometimes works, sometimes doesn't).
I have also tested whether it works reliably when just setting it on/off in a single view and it doesn't seem to work. Here is a gist: https://gist.github.com/ustun/5670b7480569fbb784a4
The text was updated successfully, but these errors were encountered: