-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
currentScene is not showing the currently mounted screens key #3165
Comments
@SourceCipher Could you reproduce this issue with Example project? The main difference between current RNRF version and older is that currentScene is set AFTER component is mounted/rendered (because React Navigation does that). So for custom navbars you have to read currentScene from actual |
You may also check
|
@aksonov I am using mobx but I dont think adding with observables is a good idea. I will try using navigation.state even tho not really sure how to implement it :/ But using |
For mobx it is even easier (we are using it) - just create simple mobx store
and then you can observe |
@aksonov oh I see.. I think I can do that with the mobx the same way as well Updated: Your solution worked after I used this with Mobx. Well done |
Thank you @SourceCipher for letting us know that the solution provided worked. Closing this one. |
If you implement onEnter event in the scene, the currentScene updates correctly. |
Version
Tell us which versions you are using:
Expected behaviour
If opening the screen with the key 'main', currentScene should show the main screens key
Actual behaviour
If the screen opens with the key 'main' it should show this key in currentScene, but it shows the previous screens key which main was mounted from
The text was updated successfully, but these errors were encountered: