mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-27 01:34:25 +08:00
feat: export types for ScreenProps amd ScreenComponent
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
"react-native-unimodules": "~0.5.2",
|
||||
"react-native-web": "^0.11.4",
|
||||
"react-native-webview": "~5.12.0",
|
||||
"react-navigation": "^4.0.3",
|
||||
"react-navigation": "^4.0.4",
|
||||
"react-navigation-drawer": "^2.0.0",
|
||||
"react-navigation-tabs": "2.2.0"
|
||||
},
|
||||
|
||||
@@ -9451,10 +9451,10 @@ react-navigation-tabs@2.2.0:
|
||||
react-lifecycles-compat "^3.0.4"
|
||||
react-native-tab-view "^2.6.2"
|
||||
|
||||
react-navigation@^4.0.3:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-4.0.3.tgz#ba2cacb71db56e22ee50d774829ebc7fa95a0724"
|
||||
integrity sha512-oASR5gHwd6se1Mw8AM4Ie8GicD5mKzRiYP6oaQujiQroQzQPij9sXxkRSqOscd/Kw1/Hf3htvBX3ZRPbOkWsfA==
|
||||
react-navigation@^4.0.4:
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-4.0.4.tgz#afa43c7183891d38708cf57f1d4394fed1d4c2ad"
|
||||
integrity sha512-MZeVkYkFTKZobhrXMV3Hgeg0HHeokCrYsbxActVfO0n6zfzm0/La6EiC2mIHiwOymvb1ZygyFf90vryLUMEBNA==
|
||||
dependencies:
|
||||
"@react-navigation/core" "^3.5.0"
|
||||
"@react-navigation/native" "^3.6.2"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
"react-native-gesture-handler": "^1.3.0",
|
||||
"react-native-reanimated": "^1.1.0",
|
||||
"react-native-screens": "^1.0.0-alpha.23",
|
||||
"react-navigation": "^4.0.3",
|
||||
"react-navigation": "^4.0.4",
|
||||
"react-test-renderer": "16.8.3",
|
||||
"release-it": "^12.3.2",
|
||||
"scheduler": "^0.14.0",
|
||||
@@ -81,7 +81,7 @@
|
||||
"react-native-gesture-handler": "^1.0.0",
|
||||
"react-native-reanimated": "^1.3.0-alpha",
|
||||
"react-native-screens": "^1.0.0 || ^1.0.0-alpha",
|
||||
"react-navigation": "^4.0.3"
|
||||
"react-navigation": "^4.0.4"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "react-native",
|
||||
|
||||
@@ -40,4 +40,6 @@ export {
|
||||
NavigationStackProp,
|
||||
NavigationStackOptions,
|
||||
NavigationStackConfig,
|
||||
NavigationStackScreenComponent,
|
||||
NavigationStackScreenProps,
|
||||
} from './types';
|
||||
|
||||
@@ -23,7 +23,8 @@ function createStackNavigator(
|
||||
stackConfig: CreateNavigatorConfig<
|
||||
NavigationStackConfig,
|
||||
NavigationStackRouterConfig,
|
||||
NavigationStackOptions
|
||||
NavigationStackOptions,
|
||||
NavigationStackProp
|
||||
> = {}
|
||||
) {
|
||||
const router = StackRouter(routeConfigMap, stackConfig);
|
||||
|
||||
@@ -15,6 +15,8 @@ import {
|
||||
NavigationEventCallback,
|
||||
NavigationEventSubscription,
|
||||
NavigationDescriptor,
|
||||
NavigationScreenConfig,
|
||||
SupportedThemes,
|
||||
} from 'react-navigation';
|
||||
|
||||
export type NavigationStackEventName =
|
||||
@@ -126,6 +128,25 @@ export type NavigationStackConfig = {
|
||||
disableKeyboardHandling?: boolean;
|
||||
};
|
||||
|
||||
export type NavigationStackScreenProps<
|
||||
Params = NavigationParams,
|
||||
ScreenProps = unknown
|
||||
> = {
|
||||
theme: SupportedThemes;
|
||||
navigation: NavigationStackProp<NavigationRoute, Params>;
|
||||
screenProps: ScreenProps;
|
||||
};
|
||||
|
||||
export type NavigationStackScreenComponent<
|
||||
Params = NavigationParams,
|
||||
ScreenProps = unknown
|
||||
> = React.ComponentType<NavigationStackScreenProps<Params, ScreenProps>> & {
|
||||
navigationOptions?: NavigationScreenConfig<
|
||||
NavigationStackOptions,
|
||||
NavigationStackProp<NavigationRoute, Params>
|
||||
>;
|
||||
};
|
||||
|
||||
export type SceneDescriptorMap = {
|
||||
[key: string]:
|
||||
| NavigationDescriptor<
|
||||
|
||||
@@ -7333,10 +7333,10 @@ react-native@~0.59.8:
|
||||
xmldoc "^0.4.0"
|
||||
yargs "^9.0.0"
|
||||
|
||||
react-navigation@^4.0.3:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-4.0.3.tgz#ba2cacb71db56e22ee50d774829ebc7fa95a0724"
|
||||
integrity sha512-oASR5gHwd6se1Mw8AM4Ie8GicD5mKzRiYP6oaQujiQroQzQPij9sXxkRSqOscd/Kw1/Hf3htvBX3ZRPbOkWsfA==
|
||||
react-navigation@^4.0.4:
|
||||
version "4.0.4"
|
||||
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-4.0.4.tgz#afa43c7183891d38708cf57f1d4394fed1d4c2ad"
|
||||
integrity sha512-MZeVkYkFTKZobhrXMV3Hgeg0HHeokCrYsbxActVfO0n6zfzm0/La6EiC2mIHiwOymvb1ZygyFf90vryLUMEBNA==
|
||||
dependencies:
|
||||
"@react-navigation/core" "^3.5.0"
|
||||
"@react-navigation/native" "^3.6.2"
|
||||
|
||||
Reference in New Issue
Block a user