Modify functional components event listener example (#6256)
Using Navigation.events().bindComponent() to register event listeners in functional components leads to typing errors when using Typescript, as bindComponent method requires a React.Component<any> as first argument.
With registerComponentListener we achieve the exact same effect, but providing more appropiate typings for for its parameters, using NavigationComponentListener for the listener, and making componentId required.
Moves viewControllerForKey to use viewForKey with transitions where (#6238)
Moves viewControllerForKey to use viewForKey with transitions where appropriate as discussed in this Stack Overflow post: https://stackoverflow.com/questions/24338700/from-view-controller-disappears-using-uiviewcontrollercontexttransitioning/25193675#25193675
This mainly resolves an issue when using animations with `dismissModal` that results in all views being removed and a black screen appearing as discussed in #6195
The remaining `viewControllerForKey` calls should probably be removed too where their `view` property is being used, but this seems to resolve the bug for now at least!
* Fix setting root with bottomTabs.visible false
* Fix bottomTabs invisible after hiding through mergeOptions
on iOS, setting root with invisible bottomTabs doesn't work out of the box. We had to change the implementation and load the bottomTabsController children after it has been loaded to the window's rootViewController.
Fix component generator called multiple times (#6239)
Fix registered component generator function called multiple times. Apparently this hasn't resulted in actual bugs, but it's unpredictable behaviour which can easily lead to bugs and issues.
This commit caches registered components so they are created only once.
Fixes #6232
* initial commit
* Fix nested touchables in Overlay
When nesting Touchable components in an Overlay, under certain conditions, the outer most Touchable component consumed all touch events.
Fixes #5184
Co-authored-by: Yogev Ben David <yogev132@gmail.com>
Fix flickering FAB when changing bottom tabs (#6225)
* Fix flickering FAB when changing bottom tabs
Fab was instantiated with the default margin (16dp), without the containing screen's bottom inset. The caused the FAB to jump up when the screen appeared since it then received the correct bottom margins (16dp + bottom insets)
Fixes #5816
This commit somewhat consolidates how stack children are mounted.
On Android, until now, only the top child in a stack was mounted when the stack became visible or when setStackRoot() was called. When popping the stack the new current child would be mounted when it was attached. This caused flickering when popping the stack as the pop animation started before the child finished mounting.
Now all children will be mounted together after the top child is mounted :)
Co-authored-by: Yogev Ben David <yogev132@gmail.com>
When a menu is opened its resolved options are applied. These options set the enabled property of both left and right menus. If a menu is disabled, opening the other menu will unintentionally enable it when it is opened therefore we need to update the enabled properties of both menus in the actual SideMenu layout.
Closes #6182
Co-authored-by: Yogev Ben David <yogev132@gmail.com>
Fix updating button options with mergeOptions (#6219)
Updating button options with mergeOptions stopped working in 6.5.0. The regression was introduced by #6090. When updating buttons, RNN didn't take button options into account when checking if two buttons are equal, instead it checked only by button id.
closes #6205
Co-authored-by: Yogev Ben David <yogev132@gmail.com>
Fix showing Modal from TopBar components in RN 62 (#6199)
When showing React Native's Modal from a TopBar component - RNN mistakingly considered Modals as yellow boxes and removed them. Apparently this error surfaced in RN62
Consume currentTabId and currentTabIndex after they are applied (#6169)
If currentTabId or currentTabIndex were declared in default options - the specified tab was reselected each time options were applied.
Co-authored-by: Yogev Ben David <yogev132@gmail.com>