1. Remove `NavigationComponent` from `NavigationScreenRouteConfig`. The only context `NavigationScreenRouteConfig` is used in is as an intersection with an object, and as such the only relevant portions of `NavigationScreenRouteConfig` are the object parts.
2. Add static `HEIGHT` variable to `Header` type.
3. In `NavigationContainerProps`, make `onNavigationStateChange` property value nullable.
PS: if in the future you guys would prefer that I separate these sort of PRs into their constituent parts, let me know.
* Add activeLabelStyle and inactiveLabelStyle
Adding activeLabelStyle, so that active items can be customized more.
My use case: Change font of the active item to bold.
Also, added inactiveLabelStyle which can be used for a similar purpose.
* prettier fix
* Update react-navigation.js
* prettier fix
* Update jest snapshot for DrawerNavigator - for adding a new style property to the styles array
* This caches "child event subscribers" by key and removes them when they're not needed anymore. Once a navigator unmounts we also remove upstream subscribers.
* Fix tests
Should be nullable, since it is initially called as `null` in `src/createNavigationContainer.js` (and in `react-navigation-redux-helpers`, where it is causing a Flow error)
* use initialRouteName as key when initializing StackRouter
* fix null headerLeft
* merge back
* fixed tests
* use config flag
* fixed snapshots
* implemented requested changes
* Pop to top when tapping the tab icon for an already focused tab
* Dispatch popToTop with key to scope the action properly
* Add test for POP_TO_TOP with key
* First crack at publish from circle
* s/publish/deploy
* Update snapshots
* Try installing with yarn
* Nice one
* Shhh
* Comment some things out and add a webhook
* Add proper webhook url and add back build steps
* Improve `Header` performance a bit
I have been investigating `<Header />` component performance once again today with `render` cycles in particular. I have observed that during `push` phase, a typical Header in NavigationPlayground re-renders 3 times on iOS and 2 times on Android.
The first time is obvious on both platforms since that's when we add a new scene to an array. Second on iOS was also self-explanatory - we measure title width and other layout parameters in order to provide a better animation.
What got me thinking was the last render cycle that didn't have a clear origin. After digging around I've found it is caused by a `scenes` array changing when transition finishes. What is surprising, it's just the reference to the object that changes, the content (items inside) stay the same.
I have found out that this is caused by `Transitioner` looping through an array of scenes attempting to remove stale scenes. Since scene becomes stale when you `pop` from it, this is obviously a noop when `pushing` a new route. That, obviously, causes an extra render cycle since `filter` produces same, but with a different pointer, object.
* Update Transitioner.js
* Update Transitioner.js