Add <NavigationEvents/> component (#4188)

* add NavigationEvents

* expose TabsWithNavigationEvents in lib entrypoints

* Add NavigationEvents example in playground

* Add NavigationEvents example in playground

* Add NavigationEvents tests

* Add NavigationEvents Flow declarations

* remove useless NavigationEvents constructor

* NavigationEvents => make tests more readable by avoiding beforeEach callback

* fix flow test error by adding <any, any> to React.Component
This commit is contained in:
Sébastien Lorber
2018-06-29 16:34:11 +02:00
committed by Brent Vatne
parent 4e384f8057
commit 1951a3ac46
7 changed files with 457 additions and 0 deletions

View File

@@ -557,6 +557,21 @@ declare module 'react-navigation' {
navigationOptions?: O,
}>;
/**
* NavigationEvents component
*/
declare type _NavigationEventsProps = {
navigation?: NavigationScreenProp<NavigationState>,
onWillFocus?: NavigationEventCallback,
onDidFocus?: NavigationEventCallback,
onWillBlur?: NavigationEventCallback,
onDidBlur?: NavigationEventCallback,
};
declare export var NavigationEvents: React$ComponentType<
_NavigationEventsProps
>;
/**
* Navigation container
*/