Bring back TypeDefinition.js and re-add Flow to NavigationPlayground (#3363)

* Bring back TypeDefinition.js and re-add Flow to NavigationPlayground

* Type EventListener correctly and ignore metro errors
This commit is contained in:
Ashoat Tevosyan
2018-01-26 17:15:49 -07:00
committed by Brent Vatne
parent 4ae2a42a4d
commit 427e89480f
16 changed files with 94485 additions and 561 deletions

View File

@@ -2,6 +2,8 @@
* @flow
*/
import type { NavigationScreenProp, EventListener } from 'react-navigation';
import React from 'react';
import { Button, Platform, ScrollView, StatusBar, View } from 'react-native';
import { SafeAreaView, TabNavigator } from 'react-navigation';
@@ -114,8 +116,17 @@ const SimpleTabs = TabNavigator(
}
);
class SimpleTabsContainer extends React.Component {
type SimpleTabsContainerProps = {
navigation: NavigationScreenProp<*>,
};
class SimpleTabsContainer extends React.Component<SimpleTabsContainerProps> {
static router = SimpleTabs.router;
_s0: EventListener;
_s1: EventListener;
_s2: EventListener;
_s3: EventListener;
componentDidMount() {
this._s0 = this.props.navigation.addListener('willFocus', this._onWF);
this._s1 = this.props.navigation.addListener('didFocus', this._onDF);