mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-05-07 10:42:40 +08:00
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:
committed by
Brent Vatne
parent
4ae2a42a4d
commit
427e89480f
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user