Skip to content

Commit edf2938

Browse files
committed
make flow happy 🤖
1 parent 3d27fb0 commit edf2938

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

.flowconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ suppress_type=$FlowIssue
9696
suppress_type=$FlowFixMe
9797
suppress_type=$FixMe
9898

99-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(30\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
100-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(30\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
99+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
100+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
101101
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
102102

103103
unsafe.enable_getters_and_setters=true
104104

105105
[version]
106-
^0.30.0
106+
^0.32.0

modules/RouteUtils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,16 @@ function createNavigationTreeAtIndex(
7373

7474
// index route is given in `routes` but not in `childRoutes`
7575
if (route.indexRoute) {
76+
const indexRoute = route.indexRoute;
7677
const indexRouteProps = {};
7778

7879
indexRouteProps.path = '[index]';
7980
indexRouteProps.type = 'index';
80-
indexRouteProps.component = route.indexRoute.component;
81+
indexRouteProps.component = indexRoute.component;
8182
indexRouteProps.createElement = createElement;
8283

83-
if (route.indexRoute.overlayComponent) {
84-
indexRouteProps.overlayComponent = route.indexRoute.overlayComponent;
84+
if (indexRoute.overlayComponent) {
85+
indexRouteProps.overlayComponent = indexRoute.overlayComponent;
8586
}
8687

8788
const indexRoutePseudoElement = {

modules/RouteView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class RouteView extends Component<any, Props, any> {
5555

5656
if (!pseudoElement) {
5757
warnOutOfSync('Cannot render scene', scene.route.path);
58+
return null;
5859
}
5960

6061
const key = scene.route.key;

modules/StackRouteView.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class StackRouteView extends Component<any, Props, any> {
6464

6565
if (!navigationalElement) {
6666
warnOutOfSync('Cannot render overlay', scene.route.path);
67+
return null;
6768
}
6869

6970
const overlayComponent = navigationalElement.props.overlayComponent;
@@ -140,6 +141,7 @@ class StackRouteView extends Component<any, Props, any> {
140141

141142
if (!pseudoElement) {
142143
warnOutOfSync('Cannot render card', scene.route.path);
144+
return null;
143145
}
144146

145147
const { routeViewComponent, props: routeViewComponentProps } = pseudoElement;

modules/TabsRouteView.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class TabsRouteView extends Component<any, Props, any> {
6363

6464
if (!navigationalElement) {
6565
warnOutOfSync('Cannot render overlay', scene.route.path);
66+
return null;
6667
}
6768

6869
const overlayComponent = navigationalElement.props.overlayComponent;
@@ -139,6 +140,7 @@ class TabsRouteView extends Component<any, Props, any> {
139140

140141
if (!pseudoElement) {
141142
warnOutOfSync('Cannot render card', scene.route.path);
143+
return null;
142144
}
143145

144146
const { routeViewComponent, props: routeViewComponentProps } = pseudoElement;

modules/TypeDefinition.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ export type EnhancedNavigationRoute = {
3535
onSwipeForward: ?Function,
3636
};
3737

38+
export type IndexRouteDef = {
39+
component: Function,
40+
overlayComponent: ?Function,
41+
};
42+
3843
export type RouteDef = {
3944
childRoutes: ?Array<RouteDef>,
4045
component: Function,
46+
indexRoute: ?IndexRouteDef,
4147
overlayComponent: ?Function,
4248
path: ?string,
4349
routeType: ?RouteType,
@@ -47,11 +53,6 @@ export type RouteDef = {
4753
onSwipeForward: ?Function,
4854
};
4955

50-
export type IndexRouteDef = {
51-
component: Function,
52-
overlayComponent: ?Function,
53-
};
54-
5556
export type NoPathRouteDef = {
5657
childRoutes: Array<RouteDef>,
5758
component: Function,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"eslint-plugin-import": "^1.14.0",
8181
"eslint-plugin-jsx-a11y": "^2.2.1",
8282
"eslint-plugin-react": "^6.2.0",
83-
"flow-bin": "^0.30.0",
83+
"flow-bin": "^0.32.0",
8484
"gulp": "^3.9.1",
8585
"gulp-eslint": "^3.0.1",
8686
"gulp-mocha": "^3.0.1",

0 commit comments

Comments
 (0)