-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
mergeOptions does not update title component in Android #5377
Comments
I have identified the root cause of the problem. This if condition always evaluates to true: The View component does not change even if the options arrive with new RN component. That means the top bar component is never updated. The same problem should also happen for backgroundComponent If you want I can do a PR for the fix, but need guidance how to solve it. In my case it would be best to remove this check completely because I don't want some hidden caching of RN components when I explicitly specify that I want to change top bar component with mergeOptions. |
@tautvilas Any chance you could PR a failing Detox test? I'll pick it up from there |
I will try |
Hey, was this resolved? |
Any update on this? This is still an issue as of version |
This is a patch for StackPresenter.java that fixes the problem 418,420c418,420
< if (titleControllers.containsKey(component)) {
< topBar.setTitleComponent(titleControllers.get(component).getView());
< } else {
---
> //if (titleControllers.containsKey(component)) {
> // topBar.setTitleComponent(titleControllers.get(component).getView());
> //} else {
426c426
< }
---
> //} |
See wix#5377 on the main repo
See wix#5377 on the main repo
Hi, any update for this issue? |
@vodanh109 Well, the patch still works 😉 |
This commit fixes a bug related to setting a new react component as title via mergeOptions. When a title component was set, and the user tried to replace the existing title with a new title via mergeOptions, the new title was not created and instead the current title was reapplied. Fixes #5377
This commit fixes a bug related to setting a new react component as title via mergeOptions. When a title component was set, and the user tried to replace the existing title with a new title via mergeOptions, the new title was not created and instead the current title was reapplied. Fixes #5377
Hey guys, the fix is available in 6.4.0, sorry for taking so long to address this. I understand this was mostly used to replace a component with the same component, only with different props. If all you need is to update props then you should be using Navigation.updateProps. This way the component isn't recreated and the existing component's props are updated. |
This commit fixes a bug related to setting a new react component as title via mergeOptions. When a title component was set, and the user tried to replace the existing title with a new title via mergeOptions, the new title was not created and instead the current title was reapplied. Fixes wix#5377
Issue Description
If I set custom title component in android and later try to change it to another component with mergeOptions that does not work. On IOS it works fine.
Code example
If onInteractiveAction is triggered by some touch action in screen Comp2 will become visible in IOS navbar but not in Android
Environment
Thanks for developing this amazing project :) RNN is the number one navigation solution for react native apps!
The text was updated successfully, but these errors were encountered: