From 72f71ddc62896313b98261fa61bc70952ddb00df Mon Sep 17 00:00:00 2001 From: Luong Dang Hai Date: Thu, 16 May 2019 06:24:51 +0300 Subject: [PATCH] remove old exports and add export for SceneView and SwitchRouter (#5872) * remove old exports and add export for SceneView and SwitchRouter * Update CHANGELOG.md * add type arg to NavigationScreenProp --- packages/react-navigation/CHANGELOG.md | 1 + .../typescript/react-navigation.d.ts | 31 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/packages/react-navigation/CHANGELOG.md b/packages/react-navigation/CHANGELOG.md index 397176f7..7340bedc 100644 --- a/packages/react-navigation/CHANGELOG.md +++ b/packages/react-navigation/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Fixes - Update typescript - `TabBarTop` is now `MaterialTopTabBar` +- Update typescript - Remove `SwitchNavigator`, `TabNavigator` and `StackNavigator`. Added exports for `SceneView` and `SwitchRouter` - Update typescript - `getLabel` is now `getLabelText` in BottomTabProps and TopTabProps ## [3.9.0] - [2019-04-23](https://github.com/react-navigation/react-navigation/releases/tag/3.9.0) diff --git a/packages/react-navigation/typescript/react-navigation.d.ts b/packages/react-navigation/typescript/react-navigation.d.ts index c6a75360..92caeb60 100644 --- a/packages/react-navigation/typescript/react-navigation.d.ts +++ b/packages/react-navigation/typescript/react-navigation.d.ts @@ -440,6 +440,8 @@ declare module 'react-navigation' { * Switch Navigator */ + export interface SwitchRouter extends NavigationRouter {} + export interface NavigationSwitchRouterConfig { initialRouteName?: string; initialRouteParams?: NavigationParams; @@ -932,12 +934,6 @@ declare module 'react-navigation' { containerOptions?: any; } - // Return createNavigationContainer - export function StackNavigator( - routeConfigMap: NavigationRouteConfigMap, - stackConfig?: StackNavigatorConfig - ): NavigationContainer; - export function createStackNavigator( routeConfigMap: NavigationRouteConfigMap, stackConfig?: StackNavigatorConfig @@ -953,11 +949,6 @@ declare module 'react-navigation' { // Return createNavigationContainer export type _SwitchNavigatorConfig = NavigationSwitchRouterConfig; - export function SwitchNavigator( - routeConfigMap: NavigationRouteConfigMap, - switchConfig?: SwitchNavigatorConfig - ): NavigationContainer; - export function createSwitchNavigator( routeConfigMap: NavigationRouteConfigMap, switchConfig?: SwitchNavigatorConfig @@ -1089,12 +1080,6 @@ declare module 'react-navigation' { initialLayout?: InitialLayout; } - // From navigators/TabNavigator.js - export function TabNavigator( - routeConfigMap: NavigationRouteConfigMap, - drawConfig?: TabNavigatorConfig - ): NavigationContainer; - export function createBottomTabNavigator( routeConfigMap: NavigationRouteConfigMap, drawConfig?: BottomTabNavigatorConfig @@ -1474,4 +1459,16 @@ declare module 'react-navigation' { export const NavigationContext: React.Context>; export const StackGestureContext: React.Context>; export const DrawerGestureContext: React.Context>; + + /** + * SceneView + */ + + export interface SceneViewProps { + component: React.ComponentType; + screenProps: ScreenProps; + navigation: NavigationScreenProp; + } + + export class SceneView extends React.Component {} }