mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-29 01:45:49 +08:00
[react-navigation] strictNullChecks, and tests.
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
TabNavigatorConfig,
|
||||
Transitioner,
|
||||
addNavigationHelpers,
|
||||
HeaderBackButton,
|
||||
} from 'react-navigation';
|
||||
|
||||
// Constants
|
||||
@@ -97,6 +98,9 @@ class NextScreen extends React.Component<NextScreenProps, {}> {
|
||||
}
|
||||
}
|
||||
|
||||
const navigationOptions = {
|
||||
headerBackTitle: null,
|
||||
};
|
||||
const initialRouteParams: StartScreenNavigationParams = {
|
||||
id: 1,
|
||||
s: "Start",
|
||||
@@ -116,6 +120,7 @@ export const AppNavigator = StackNavigator(
|
||||
{
|
||||
initialRouteName: ROUTE_NAME_START_SCREEN,
|
||||
initialRouteParams,
|
||||
navigationOptions,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -227,6 +232,32 @@ class CustomTransitioner extends React.Component<CustomTransitionerProps, null>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Header
|
||||
*/
|
||||
function renderHeaderBackButton(schema: string): JSX.Element {
|
||||
switch ( schema ) {
|
||||
case 'compact':
|
||||
return (
|
||||
<HeaderBackButton />
|
||||
);
|
||||
|
||||
default:
|
||||
return (
|
||||
<HeaderBackButton
|
||||
onPress={() => 'noop'}
|
||||
pressColorAndroid="#ccc"
|
||||
title="Press Me"
|
||||
titleStyle={{ color: '#333' }}
|
||||
tintColor="#2196f3"
|
||||
truncatedTitle="Press"
|
||||
width={85}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const initAction: NavigationInitAction = NavigationActions.init({
|
||||
params: {
|
||||
foo: "bar"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
|
||||
Reference in New Issue
Block a user