Make Router({ RouteName: Component }) a valid way to configure a router (#3486)

* Make Router({routeName: Component}) a valid way to instantiate a route

* Update App.js in NavigationPlayground

* Fix route config flow type
This commit is contained in:
Brent Vatne
2018-02-09 18:20:01 -08:00
committed by GitHub
parent 1d49b6e3fe
commit 58b77d44ae
6 changed files with 43 additions and 86 deletions

View File

@@ -332,12 +332,15 @@ declare module 'react-navigation' {
navigationOptions?: ?NavigationScreenConfig<Options>,
};
declare export type NavigationRouteConfig = {
declare export type NavigationRouteConfig =
| NavigationComponent
| {
navigationOptions?: NavigationScreenConfig<*>,
path?: string,
} & NavigationScreenRouteConfig;
declare export type NavigationScreenRouteConfig =
| NavigationComponent
| {
screen: NavigationComponent,
}