mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-20 10:58:14 +08:00
Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
338d5c2364 | ||
|
|
40e7ff1655 | ||
|
|
d1419cd2ed | ||
|
|
cd342935a1 | ||
|
|
97d21c39be | ||
|
|
2f38d420aa | ||
|
|
6d9bc8d869 | ||
|
|
8e57aae5cf | ||
|
|
b464e15718 | ||
|
|
a874d5774c | ||
|
|
96cb00b5a6 | ||
|
|
9a8a34636d | ||
|
|
950d5ef6d2 | ||
|
|
542122794a | ||
|
|
4c81fbefc3 | ||
|
|
bd2daa809f | ||
|
|
5e07cd2601 | ||
|
|
cd22810be6 | ||
|
|
3f8a4d491c | ||
|
|
837fc0bc25 | ||
|
|
57d2bbeb96 | ||
|
|
e3c38aefe8 | ||
|
|
fb7da05beb | ||
|
|
5d097b92f4 | ||
|
|
60618d5d1d | ||
|
|
28e1753434 | ||
|
|
48b1bd965b | ||
|
|
6e80d7c75a | ||
|
|
1c75f17a86 | ||
|
|
e542c84e29 | ||
|
|
a7265155bd | ||
|
|
69e40950b1 | ||
|
|
3deec699ee | ||
|
|
2c875e39ae | ||
|
|
8788dd77b4 | ||
|
|
71cb16dc7f | ||
|
|
445dcfcdf2 | ||
|
|
ec97b610c5 | ||
|
|
b9f50bd012 | ||
|
|
dbf165dbe7 | ||
|
|
bd09153448 | ||
|
|
c766a66be8 | ||
|
|
53bb89c1e3 | ||
|
|
4c29c57fe2 | ||
|
|
368b6812bf | ||
|
|
73d416ec02 | ||
|
|
89786a39ab | ||
|
|
dfa4a715a0 | ||
|
|
6844559273 | ||
|
|
acd15dd409 | ||
|
|
c428b63484 | ||
|
|
7a0159ef32 | ||
|
|
c4278e5250 | ||
|
|
2d6a284226 | ||
|
|
23389b3774 |
@@ -1,39 +1,11 @@
|
||||
version: 2
|
||||
version: 3
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: reactcommunity/node-ci:8.4.0-0 # custom image -- includes ocaml, libelf1, Yarn
|
||||
- image: circleci/node:10
|
||||
parallelism: 2
|
||||
working_directory: ~/react-navigation
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
# cache by branch + package.json, by branch, and then master
|
||||
keys:
|
||||
- v3-react-navigation-{{ .Branch }}-{{ checksum "package.json" }}
|
||||
- v3-react-navigation-{{ .Branch }}
|
||||
- v3-react-navigation-master
|
||||
- run: yarn # install root deps
|
||||
- run: ./scripts/test.sh # run tests
|
||||
- setup_remote_docker
|
||||
# - deploy:
|
||||
# command: |
|
||||
# set -x
|
||||
# VER="17.03.0-ce"
|
||||
# curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
|
||||
# tar -xz -C /tmp -f /tmp/docker-$VER.tgz
|
||||
# mv /tmp/docker/* /usr/bin
|
||||
#
|
||||
# yarn global add exp
|
||||
# set +x
|
||||
# exp login -u "$EXPO_USERNAME" -p "$EXPO_PASSWORD"
|
||||
# set -x
|
||||
# cd examples/NavigationPlayground && yarn && exp publish --release-channel "${CIRCLE_SHA1}"
|
||||
- save_cache:
|
||||
key: v3-react-navigation-{{ .Branch }}-{{ checksum "package.json" }}
|
||||
paths:
|
||||
- ~/.cache/yarn
|
||||
- ~/react-navigation/examples/NavigationPlayground/node_modules
|
||||
# notify:
|
||||
# webhooks:
|
||||
# - url: https://react-navigation-ci.now.sh
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: ./scripts/test.sh
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -13,8 +13,8 @@ yarn-error.log
|
||||
# OS X
|
||||
.DS_Store
|
||||
|
||||
# Exponent
|
||||
.exponent
|
||||
# Expo
|
||||
.expo
|
||||
|
||||
# Jest
|
||||
coverage
|
||||
|
||||
125
CHANGELOG.md
125
CHANGELOG.md
@@ -5,7 +5,118 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
## [3.10.2]
|
||||
|
||||
## Fixes
|
||||
|
||||
- Update Flow types - Add `cardShadowEnabled` and `cardOverlayEnabled` to NavigationStackViewConfig
|
||||
- Upgrade react-navigation-tabs [#5914](https://github.com/react-navigation/react-navigation/issues/5914)
|
||||
|
||||
## [3.10.0] - [2019-05-16](https://github.com/react-navigation/react-navigation/releases/tag/3.10.0)
|
||||
|
||||
## Removed
|
||||
|
||||
- `persistenceKey` no longer automatically saves and restores navigation state using AsyncStorage. Typically this would be a breaking change that would require a major version bump, but because this has always been marked as experimental in the documentation and it is unlikely to impact production apps, we are rolling it in a minor release. `persistenceKey` has been replaced with `persistNavigationState` and `loadNavigationState`. See the diff in docs: https://github.com/react-navigation/react-navigation.github.io/pull/425/files?short_path=b668b1a#diff-b668b1a4201e40b1378036dc012100fe
|
||||
|
||||
## Changed
|
||||
|
||||
- Removed animations from stack on web
|
||||
- Ensure that headerMode is float by default on web
|
||||
|
||||
## Fixes
|
||||
|
||||
- Prevent transitionConfig's useNativeDriver value being overwritten. (https://github.com/react-navigation/stack/commit/8b2af7d94209d4658abd8d799bc78744a1004b4e)
|
||||
- Update typescript with headerLeftContainerStyle and headerRightContainerStyle
|
||||
- Update typescript - Add `safeAreaInset` to `BottomTabBarProps`
|
||||
- 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
|
||||
- Silence deprecated lifecycle warning in Stack Transitioner
|
||||
|
||||
## [3.9.0] - [2019-04-23](https://github.com/react-navigation/react-navigation/releases/tag/3.9.0)
|
||||
|
||||
## Fixes
|
||||
|
||||
- Remove `createTabNavigator` from type definitions
|
||||
- Add missing types for `DrawerNavigatorConfig`
|
||||
- Use `preserveFocus` action param rather than matching on specific action types to determine if index needs to be updated if child router changes (https://github.com/react-navigation/react-navigation-core/pull/56)
|
||||
|
||||
## [3.8.1] - [2019-04-12](https://github.com/react-navigation/react-navigation/releases/tag/3.8.1)
|
||||
|
||||
## Changed
|
||||
|
||||
- Add missing type for `enableURLHandling` to TypeScript definition (#5803)
|
||||
- Update Flow types (#5806)
|
||||
|
||||
## [3.8.0] - [2019-04-12](https://github.com/react-navigation/react-navigation/releases/tag/3.8.0)
|
||||
|
||||
## Fixes
|
||||
|
||||
- `onRefresh` on exported lists `FlatList` and `SectionList` works as expected now (no need to add `refreshControl` prop explicitly)
|
||||
- On Android, the exported `ScrollView` is now same as the React Native ScrollView (but with scroll-to-top behavior added), whereas on iOS we still use react-native-gesture-handler ScrollView. We can change Android back to react-native-gesture-handler ScrollView when https://github.com/kmagiera/react-native-gesture-handler/issues/560 is resolved.
|
||||
- Look for `scrollResponderScrollTo` function in our ScrollView, in react-native 0.59 the interface appears to have changed for FlatList such that this is needed. (react-navigation-native#20)
|
||||
|
||||
## Changed
|
||||
|
||||
- Stack header style improvements for web (react-navigation-stack#104)
|
||||
|
||||
## [3.7.1] - [2019-04-10](https://github.com/react-navigation/react-navigation/releases/tag/3.7.1)
|
||||
|
||||
## Fixes
|
||||
|
||||
- Update Flow types (#5800 and #5801)
|
||||
- More open `navigationOptions` types for bottom tab navigator config (#5796)
|
||||
- Fix hit slop for bottom tab bar (react-navigation-tabs#110)
|
||||
|
||||
## Added
|
||||
|
||||
- Add accessibility role and state to bottom bar (react-navigation-tabs#90)
|
||||
- Hide tab bar when keyboard is shown (react-navigation-tabs#112)
|
||||
- Specify default values for getAccessibilityX on tabs (react-navigation-tabs##116)
|
||||
- Add a isFirstRouteInParent method to navigation object (react-navigation-core#51)
|
||||
|
||||
## [3.6.1] - [2019-04-02](https://github.com/react-navigation/react-navigation/releases/tag/3.6.1)
|
||||
|
||||
## Fixed
|
||||
|
||||
- Move event subscriptions to constructor in `withNavigationFocus` to ensure initial `didFocus` event is received.
|
||||
|
||||
## [3.6.0] - [2019-03-31](https://github.com/react-navigation/react-navigation/releases/tag/3.6.0)
|
||||
|
||||
## Added
|
||||
|
||||
- Export TabBarIconProps, TabBarLabelProps, DrawerIconProps, DrawerLabelProps, ScreenProps and InitialLayout.
|
||||
- Add `disabled` prop to HeaderBackButton
|
||||
- Add `StackViewTransitionConfigs.NoAnimation`
|
||||
- Add `drawerContainerStyle` to navigator config for drawer navigator
|
||||
|
||||
## [3.5.1] - [2019-03-19](https://github.com/react-navigation/react-navigation/releases/tag/3.5.1)
|
||||
|
||||
## Added
|
||||
|
||||
- Export StackGestureContext and DrawerGestureContext
|
||||
- Add missing type for withOrientation
|
||||
|
||||
## Fixed
|
||||
|
||||
- Fix header HeaderBackButton title TypeScript type
|
||||
|
||||
## [3.5.0] - [2019-03-19](https://github.com/react-navigation/react-navigation/releases/tag/3.5.0)
|
||||
|
||||
## Fixed
|
||||
|
||||
- Fixed types for `BottomTabBar`
|
||||
- export `NavigationContext` type
|
||||
|
||||
## Changed
|
||||
|
||||
- Make 'react-native-gesture-handler' a peer dependency rather than a hard dependency
|
||||
|
||||
## [3.4.1] - [2019-03-16](https://github.com/react-navigation/react-navigation/releases/tag/3.4.1)
|
||||
|
||||
## Fixed
|
||||
|
||||
- Fix missing TypeScript definitions file in release package
|
||||
|
||||
## [3.4.0] - [2019-03-15](https://github.com/react-navigation/react-navigation/releases/tag/3.4.0)
|
||||
|
||||
@@ -172,7 +283,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
- [2.x](https://github.com/react-navigation/react-navigation/blob/2.x/CHANGELOG.md)
|
||||
|
||||
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/3.4.0...HEAD
|
||||
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/3.10.0...HEAD
|
||||
[3.10.0]: https://github.com/react-navigation/react-navigation/compare/3.10.0...3.9.0
|
||||
[3.9.0]: https://github.com/react-navigation/react-navigation/compare/3.8.1...3.9.0
|
||||
[3.8.1]: https://github.com/react-navigation/react-navigation/compare/3.8.0...3.8.1
|
||||
[3.8.0]: https://github.com/react-navigation/react-navigation/compare/3.7.1...3.8.0
|
||||
[3.7.1]: https://github.com/react-navigation/react-navigation/compare/3.6.1...3.7.1
|
||||
[3.6.1]: https://github.com/react-navigation/react-navigation/compare/3.6.0...3.6.1
|
||||
[3.6.0]: https://github.com/react-navigation/react-navigation/compare/3.5.1...3.6.0
|
||||
[3.5.1]: https://github.com/react-navigation/react-navigation/compare/3.5.0...3.5.1
|
||||
[3.5.0]: https://github.com/react-navigation/react-navigation/compare/3.4.1...3.5.0
|
||||
[3.4.1]: https://github.com/react-navigation/react-navigation/compare/3.4.0...3.4.1
|
||||
[3.4.0]: https://github.com/react-navigation/react-navigation/compare/3.3.2...3.4.0
|
||||
[3.3.2]: https://github.com/react-navigation/react-navigation/compare/3.3.1...3.3.2
|
||||
[3.3.1]: https://github.com/react-navigation/react-navigation/compare/3.3.0...3.3.1
|
||||
|
||||
@@ -33,7 +33,7 @@ See our [Contributing Guide](CONTRIBUTING.md)!
|
||||
|
||||
#### Is this the only library available for navigation?
|
||||
|
||||
Certainly not! There other libraries - which, depending on your needs, can be better or worse suited for your project. Read more in the [alternative libraries](https://reactnavigation.org/docs/alternatives.html) documentation, and read React Navigation's [pitch & anti-pitch](https://reactnavigation.org/docs/pitch.html) to understand the tradeoffs.
|
||||
Certainly not! There are other libraries - which, depending on your needs, can be better or worse suited for your project. Read more in the [alternative libraries](https://reactnavigation.org/docs/alternatives.html) documentation, and read React Navigation's [pitch & anti-pitch](https://reactnavigation.org/docs/pitch.html) to understand the tradeoffs.
|
||||
|
||||
#### Can I use this library for web?
|
||||
|
||||
|
||||
3
babel.config.js
Normal file
3
babel.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
presets: ['module:metro-react-native-babel-preset'],
|
||||
};
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
View,
|
||||
Platform,
|
||||
} from 'react-native';
|
||||
import { createStackNavigator, createSwitchNavigator } from 'react-navigation';
|
||||
import { Button } from './commonComponents/ButtonWithMargin';
|
||||
@@ -53,7 +54,7 @@ class HomeScreen extends React.Component<any, any> {
|
||||
};
|
||||
|
||||
signOutAsync = async () => {
|
||||
await AsyncStorage.clear();
|
||||
Platform.OS === 'ios' ? await AsyncStorage.getAllKeys().then(AsyncStorage.multiRemove) : await AsyncStorage.clear()
|
||||
this.props.navigation.navigate('Auth');
|
||||
};
|
||||
}
|
||||
@@ -73,7 +74,7 @@ class OtherScreen extends React.Component<any, any> {
|
||||
}
|
||||
|
||||
signOutAsync = async () => {
|
||||
await AsyncStorage.clear();
|
||||
Platform.OS === 'ios' ? await AsyncStorage.getAllKeys().then(AsyncStorage.multiRemove) : await AsyncStorage.clear()
|
||||
this.props.navigation.navigate('Auth');
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"postinstall": "patch-package && rm -rf node_modules/react-navigation/node_modules/react-native && rm -rf node_modules/react-navigation/node_modules/@types && rm -rf node_modules/react-navigation/node_modules/examples && rm -rf node_modules/react-navigation/node_modules/react-native-gesture-handler && rm -rf node_modules/react-navigation/node_modules/react",
|
||||
"start": "node node_modules/react-native/local-cli/cli.js start",
|
||||
"test": "jest && tsc",
|
||||
"tsc": "tsc"
|
||||
"tsc": "tsc",
|
||||
"release": "release-it"
|
||||
},
|
||||
"dependencies": {
|
||||
"patch-package": "^6.0.5",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
87
flow/react-navigation.js
vendored
87
flow/react-navigation.js
vendored
@@ -238,6 +238,7 @@ declare module 'react-navigation' {
|
||||
*/
|
||||
index: number,
|
||||
routes: Array<NavigationRoute>,
|
||||
isTransitioning?: boolean,
|
||||
};
|
||||
|
||||
declare export type NavigationRoute =
|
||||
@@ -352,12 +353,8 @@ declare module 'react-navigation' {
|
||||
declare export type NavigationScreenComponent<
|
||||
Route: NavigationRoute,
|
||||
Options: {},
|
||||
Props: {}
|
||||
> = React$ComponentType<{
|
||||
...Props,
|
||||
...NavigationNavigatorProps<Options, Route>,
|
||||
}> &
|
||||
withOptionalNavigationOptions<Options>;
|
||||
Props: NavigationNavigatorProps<Options, Route>
|
||||
> = React$ComponentType<Props> & withOptionalNavigationOptions<Options>;
|
||||
|
||||
declare interface withRouter<State, Options> {
|
||||
router: NavigationRouter<State, Options>;
|
||||
@@ -366,11 +363,8 @@ declare module 'react-navigation' {
|
||||
declare export type NavigationNavigator<
|
||||
State: NavigationState,
|
||||
Options: {},
|
||||
Props: {}
|
||||
> = React$StatelessFunctionalComponent<{
|
||||
...Props,
|
||||
...NavigationNavigatorProps<Options, State>,
|
||||
}> &
|
||||
Props: NavigationNavigatorProps<Options, State>
|
||||
> = React$ComponentType<Props> &
|
||||
withRouter<State, Options> &
|
||||
withOptionalNavigationOptions<Options>;
|
||||
|
||||
@@ -407,7 +401,9 @@ declare module 'react-navigation' {
|
||||
NavigationSceneRendererProps & {
|
||||
mode: HeaderMode,
|
||||
router: NavigationRouter<NavigationState, NavigationStackScreenOptions>,
|
||||
getScreenDetails: NavigationScene => NavigationScreenDetails<NavigationStackScreenOptions>,
|
||||
getScreenDetails: NavigationScene => NavigationScreenDetails<
|
||||
NavigationStackScreenOptions
|
||||
>,
|
||||
leftInterpolator: (props: NavigationSceneRendererProps) => {},
|
||||
titleInterpolator: (props: NavigationSceneRendererProps) => {},
|
||||
rightInterpolator: (props: NavigationSceneRendererProps) => {},
|
||||
@@ -455,21 +451,29 @@ declare module 'react-navigation' {
|
||||
headerLayoutPreset?: 'left' | 'center',
|
||||
headerBackTitleVisible?: boolean,
|
||||
cardStyle?: ViewStyleProp,
|
||||
cardShadowEnabled?: boolean,
|
||||
cardOverlayEnabled?: boolean,
|
||||
transitionConfig?: (
|
||||
transitionProps: NavigationTransitionProps,
|
||||
prevTransitionProps: ?NavigationTransitionProps,
|
||||
isModal: boolean
|
||||
) => TransitionConfig,
|
||||
onTransitionStart?: () => void,
|
||||
onTransitionEnd?: () => void,
|
||||
onTransitionStart?: (
|
||||
transitionProps: NavigationTransitionProps,
|
||||
prevTransitionProps: ?NavigationTransitionProps
|
||||
) => void,
|
||||
onTransitionEnd?: (
|
||||
transitionProps: NavigationTransitionProps,
|
||||
prevTransitionProps: ?NavigationTransitionProps
|
||||
) => void,
|
||||
transparentCard?: boolean,
|
||||
disableKeyboardHandling?: boolean,
|
||||
|};
|
||||
|
||||
declare export type StackNavigatorConfig = {|
|
||||
declare export type StackNavigatorConfig = $Shape<{|
|
||||
...NavigationStackViewConfig,
|
||||
...NavigationStackRouterConfig,
|
||||
|};
|
||||
|}>;
|
||||
|
||||
/**
|
||||
* Switch Navigator
|
||||
@@ -586,7 +590,7 @@ declare module 'react-navigation' {
|
||||
fallback?: $ElementType<
|
||||
$PropertyType<
|
||||
{|
|
||||
...{| params: {| [ParamName]: void |} |},
|
||||
...{| params: {} |},
|
||||
...$Exact<S>,
|
||||
|},
|
||||
'params'
|
||||
@@ -596,14 +600,14 @@ declare module 'react-navigation' {
|
||||
) => $ElementType<
|
||||
$PropertyType<
|
||||
{|
|
||||
...{| params: {| [ParamName]: void |} |},
|
||||
...{| params: {} |},
|
||||
...$Exact<S>,
|
||||
|},
|
||||
'params'
|
||||
>,
|
||||
ParamName
|
||||
>,
|
||||
dangerouslyGetParent: () => NavigationScreenProp<*>,
|
||||
dangerouslyGetParent: () => ?NavigationScreenProp<NavigationState>,
|
||||
isFocused: () => boolean,
|
||||
// Shared action creators that exist for all routers
|
||||
goBack: (routeKey?: ?string) => boolean,
|
||||
@@ -658,7 +662,9 @@ declare module 'react-navigation' {
|
||||
onWillBlur?: NavigationEventCallback,
|
||||
onDidBlur?: NavigationEventCallback,
|
||||
};
|
||||
declare export var NavigationEvents: React$ComponentType<_NavigationEventsProps>;
|
||||
declare export var NavigationEvents: React$ComponentType<
|
||||
_NavigationEventsProps
|
||||
>;
|
||||
|
||||
/**
|
||||
* Navigation container
|
||||
@@ -667,11 +673,8 @@ declare module 'react-navigation' {
|
||||
declare export type NavigationContainer<
|
||||
State: NavigationState,
|
||||
Options: {},
|
||||
Props: {}
|
||||
> = React$ComponentType<{
|
||||
...Props,
|
||||
...NavigationContainerProps<State, Options>,
|
||||
}> &
|
||||
Props: NavigationContainerProps<Options, State>
|
||||
> = React$ComponentType<Props> &
|
||||
withRouter<State, Options> &
|
||||
withOptionalNavigationOptions<Options>;
|
||||
|
||||
@@ -709,6 +712,7 @@ declare module 'react-navigation' {
|
||||
isStale: boolean,
|
||||
key: string,
|
||||
route: NavigationRoute,
|
||||
descriptor: ?NavigationDescriptor,
|
||||
};
|
||||
|
||||
declare export type NavigationTransitionProps = $Shape<{
|
||||
@@ -920,9 +924,9 @@ declare module 'react-navigation' {
|
||||
router: NavigationRouter<S, O>,
|
||||
};
|
||||
|
||||
declare type NavigationDescriptor = {
|
||||
declare export type NavigationDescriptor = {
|
||||
key: string,
|
||||
state: NavigationLeafRoute | NavigationStateRoute,
|
||||
state: NavigationRoute,
|
||||
navigation: NavigationScreenProp<*>,
|
||||
getComponent: () => React$ComponentType<{}>,
|
||||
};
|
||||
@@ -930,6 +934,7 @@ declare module 'react-navigation' {
|
||||
declare type NavigationView<O, S> = React$ComponentType<{
|
||||
descriptors: { [key: string]: NavigationDescriptor },
|
||||
navigation: NavigationScreenProp<S>,
|
||||
navigationConfig: *,
|
||||
}>;
|
||||
|
||||
declare export function createNavigator<O: *, S: *, NavigatorConfig: *>(
|
||||
@@ -1037,7 +1042,9 @@ declare module 'react-navigation' {
|
||||
*/
|
||||
transitionConfig?: () => TransitionConfig,
|
||||
} & NavigationNavigatorProps<NavigationStackScreenOptions, NavigationState>;
|
||||
declare export var CardStackTransitioner: React$ComponentType<_CardStackTransitionerProps>;
|
||||
declare export var CardStackTransitioner: React$ComponentType<
|
||||
_CardStackTransitionerProps
|
||||
>;
|
||||
|
||||
declare type _CardStackProps = {
|
||||
screenProps?: {},
|
||||
@@ -1108,7 +1115,9 @@ declare module 'react-navigation' {
|
||||
truncatedTitle?: ?string,
|
||||
width?: ?number,
|
||||
};
|
||||
declare export var HeaderBackButton: React$ComponentType<_HeaderBackButtonProps>;
|
||||
declare export var HeaderBackButton: React$ComponentType<
|
||||
_HeaderBackButtonProps
|
||||
>;
|
||||
|
||||
declare type _DrawerViewProps = {
|
||||
drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open',
|
||||
@@ -1174,7 +1183,7 @@ declare module 'react-navigation' {
|
||||
};
|
||||
declare export var TabView: React$ComponentType<_TabViewProps>;
|
||||
|
||||
declare type _TabBarTopProps = {
|
||||
declare type _MaterialTopTabBarProps = {
|
||||
activeTintColor: string,
|
||||
inactiveTintColor: string,
|
||||
showIcon: boolean,
|
||||
@@ -1198,9 +1207,18 @@ declare module 'react-navigation' {
|
||||
labelStyle?: TextStyleProp,
|
||||
iconStyle?: ViewStyleProp,
|
||||
};
|
||||
declare export var TabBarTop: React$ComponentType<_TabBarTopProps>;
|
||||
declare export var MaterialTopTabBar: React$ComponentType<
|
||||
_MaterialTopTabBarProps
|
||||
>;
|
||||
|
||||
declare type _TabBarBottomProps = {
|
||||
declare type _BottomTabBarButtonComponentProps = {
|
||||
onPress: () => void,
|
||||
onLongPress: () => void,
|
||||
testID: string,
|
||||
accessibilityLabel: string,
|
||||
style: ViewStyleProp,
|
||||
};
|
||||
declare type _BottomTabBarProps = {
|
||||
activeTintColor: string,
|
||||
activeBackgroundColor: string,
|
||||
adaptive?: boolean,
|
||||
@@ -1223,13 +1241,16 @@ declare module 'react-navigation' {
|
||||
}) => void,
|
||||
getTestIDProps: (scene: TabScene) => (scene: TabScene) => any,
|
||||
renderIcon: (scene: TabScene) => React$Node,
|
||||
getButtonComponent: (
|
||||
scene: TabScene
|
||||
) => React$ComponentType<_BottomTabBarButtonComponentProps>,
|
||||
style?: ViewStyleProp,
|
||||
animateStyle?: ViewStyleProp,
|
||||
labelStyle?: TextStyleProp,
|
||||
tabStyle?: ViewStyleProp,
|
||||
showIcon?: boolean,
|
||||
};
|
||||
declare export var TabBarBottom: React$ComponentType<_TabBarBottomProps>;
|
||||
declare export var BottomTabBar: React$ComponentType<_BottomTabBarProps>;
|
||||
|
||||
declare export function withNavigation<
|
||||
Props: {},
|
||||
|
||||
22
package.json
22
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-navigation",
|
||||
"version": "3.4.0",
|
||||
"version": "3.10.2",
|
||||
"description": "Routing and navigation for your React Native apps",
|
||||
"main": "src/react-navigation.js",
|
||||
"types": "typescript/react-navigation.d.ts",
|
||||
@@ -28,18 +28,19 @@
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
"NavigationTestUtils.js"
|
||||
"NavigationTestUtils.js",
|
||||
"typescript"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
"react-native": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/core": "3.2.0",
|
||||
"@react-navigation/native": "3.1.5",
|
||||
"react-navigation-drawer": "1.3.0",
|
||||
"react-navigation-stack": "1.1.1",
|
||||
"react-navigation-tabs": "1.0.2"
|
||||
"@react-navigation/core": "~3.4.1",
|
||||
"@react-navigation/native": "~3.5.0",
|
||||
"react-navigation-drawer": "~1.2.1",
|
||||
"react-navigation-stack": "~1.4.0",
|
||||
"react-navigation-tabs": "~1.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react-native": "~0.57.38",
|
||||
@@ -49,7 +50,6 @@
|
||||
"babel-jest": "^22.4.1",
|
||||
"babel-preset-react-native": "^2.1.0",
|
||||
"codecov": "^2.2.0",
|
||||
"conventional-changelog-cli": "^2.0.5",
|
||||
"eslint": "^4.2.0",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
@@ -57,13 +57,13 @@
|
||||
"eslint-plugin-prettier": "^2.6.0",
|
||||
"eslint-plugin-react": "^7.1.0",
|
||||
"husky": "^0.14.3",
|
||||
"jest": "^22.1.3",
|
||||
"jest": "^24.5.0",
|
||||
"jest-expo": "^25.1.0",
|
||||
"lint-staged": "^4.2.1",
|
||||
"prettier": "^1.12.1",
|
||||
"prettier-eslint": "^8.8.1",
|
||||
"react": "16.2.0",
|
||||
"react-native": "^0.52.0",
|
||||
"react": "16.6.1",
|
||||
"react-native": "~0.57.7",
|
||||
"react-native-vector-icons": "^4.2.0",
|
||||
"react-test-renderer": "^16.0.0",
|
||||
"release-it": "^7.6.1"
|
||||
|
||||
@@ -4,5 +4,5 @@ set -eo pipefail
|
||||
|
||||
case $CIRCLE_NODE_INDEX in
|
||||
0) yarn test && yarn codecov ;;
|
||||
1) cd examples/NavigationPlayground && yarn && yarn test ;;
|
||||
1) yarn && cd examples/NavigationPlayground && yarn && yarn test ;;
|
||||
esac
|
||||
|
||||
9
src/react-navigation.js
vendored
9
src/react-navigation.js
vendored
@@ -121,6 +121,15 @@ module.exports = {
|
||||
return require('react-navigation-drawer').createDrawerNavigator;
|
||||
},
|
||||
|
||||
// Gesture contexts
|
||||
|
||||
get StackGestureContext() {
|
||||
return require('react-navigation-stack').StackGestureContext;
|
||||
},
|
||||
get DrawerGestureContext() {
|
||||
return require('react-navigation-drawer').DrawerGestureContext;
|
||||
},
|
||||
|
||||
// Routers and Actions
|
||||
|
||||
get DrawerRouter() {
|
||||
|
||||
185
typescript/react-navigation.d.ts
vendored
185
typescript/react-navigation.d.ts
vendored
@@ -33,6 +33,8 @@
|
||||
|
||||
declare module 'react-navigation' {
|
||||
import * as React from 'react';
|
||||
import { PanGestureHandler } from 'react-native-gesture-handler';
|
||||
|
||||
import {
|
||||
Animated,
|
||||
TextStyle,
|
||||
@@ -64,10 +66,14 @@ declare module 'react-navigation' {
|
||||
|
||||
export const HeaderStyleInterpolator: HeaderStyleInterpolatorStatic;
|
||||
|
||||
export type ScreenProps = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
// @todo - any..
|
||||
export function getActiveChildNavigationOptions<S>(
|
||||
navigation: NavigationProp<S>,
|
||||
screenProps?: object
|
||||
screenProps?: ScreenProps
|
||||
): NavigationParams;
|
||||
|
||||
// @todo when we split types into common, native and web,
|
||||
@@ -170,7 +176,7 @@ declare module 'react-navigation' {
|
||||
|
||||
export type NavigationScreenOptionsGetter<Options> = (
|
||||
navigation: NavigationScreenProp<NavigationRoute<any>>,
|
||||
screenProps?: { [key: string]: any }
|
||||
screenProps?: ScreenProps
|
||||
) => Options;
|
||||
|
||||
export interface NavigationRouter<State = NavigationState, Options = {}> {
|
||||
@@ -231,7 +237,7 @@ declare module 'react-navigation' {
|
||||
|
||||
export interface NavigationScreenConfigProps {
|
||||
navigation: NavigationScreenProp<NavigationRoute>;
|
||||
screenProps: { [key: string]: any };
|
||||
screenProps: ScreenProps;
|
||||
}
|
||||
|
||||
export type NavigationScreenConfig<Options> =
|
||||
@@ -434,6 +440,8 @@ declare module 'react-navigation' {
|
||||
* Switch Navigator
|
||||
*/
|
||||
|
||||
export interface SwitchRouter extends NavigationRouter {}
|
||||
|
||||
export interface NavigationSwitchRouterConfig {
|
||||
initialRouteName?: string;
|
||||
initialRouteParams?: NavigationParams;
|
||||
@@ -466,6 +474,8 @@ declare module 'react-navigation' {
|
||||
headerPressColorAndroid?: string;
|
||||
headerRight?: React.ReactElement<any> | null;
|
||||
headerStyle?: StyleProp<ViewStyle>;
|
||||
headerLeftContainerStyle?: StyleProp<ViewStyle>;
|
||||
headerRightContainerStyle?: StyleProp<ViewStyle>;
|
||||
headerForceInset?: HeaderForceInset;
|
||||
headerBackground?: React.ReactNode | React.ReactType;
|
||||
headerBackgroundTransitionPreset?: 'toggle' | 'fade' | 'translate';
|
||||
@@ -539,18 +549,19 @@ declare module 'react-navigation' {
|
||||
paths?: NavigationPathsConfig;
|
||||
order?: string[]; // todo: type these as the real route names rather than 'string'
|
||||
backBehavior?: 'none' | 'initialRoute' | 'history' | 'order'; // defaults to 'initialRoute'
|
||||
resetOnBlur?: boolean;
|
||||
}
|
||||
export interface NavigationTabRouterConfig
|
||||
extends NavigationTabRouterConfigBase {
|
||||
defaultNavigationOptions?: NavigationScreenConfig<NavigationScreenOptions>;
|
||||
navigationOptions?: NavigationTabRouterConfigBase;
|
||||
navigationOptions?: NavigationScreenConfig<any>;
|
||||
}
|
||||
export interface NavigationBottomTabRouterConfig
|
||||
extends NavigationTabRouterConfigBase {
|
||||
defaultNavigationOptions?: NavigationScreenConfig<
|
||||
NavigationBottomTabScreenOptions
|
||||
>;
|
||||
navigationOptions?: NavigationTabRouterConfigBase;
|
||||
navigationOptions?: NavigationScreenConfig<any>;
|
||||
}
|
||||
export interface TabScene {
|
||||
route: NavigationRoute;
|
||||
@@ -558,23 +569,30 @@ declare module 'react-navigation' {
|
||||
index: number;
|
||||
tintColor?: string;
|
||||
}
|
||||
|
||||
export interface TabBarIconProps {
|
||||
tintColor: string | null;
|
||||
focused: boolean;
|
||||
horizontal: boolean;
|
||||
}
|
||||
|
||||
export interface TabBarLabelProps {
|
||||
tintColor: string | null;
|
||||
focused: boolean;
|
||||
}
|
||||
|
||||
// tslint:disable-next-line:strict-export-declare-modifiers
|
||||
interface NavigationTabScreenOptionsBase {
|
||||
title?: string;
|
||||
tabBarIcon?:
|
||||
| React.ReactElement<any>
|
||||
| ((options: {
|
||||
tintColor: string | null;
|
||||
focused: boolean;
|
||||
horizontal: boolean;
|
||||
}) => React.ReactElement<any> | null);
|
||||
| ((options: TabBarIconProps) => React.ReactElement<any> | null);
|
||||
tabBarLabel?:
|
||||
| string
|
||||
| React.ReactElement<any>
|
||||
| ((options: {
|
||||
tintColor: string | null;
|
||||
focused: boolean;
|
||||
}) => React.ReactElement<any> | string | null);
|
||||
| ((
|
||||
options: TabBarLabelProps
|
||||
) => React.ReactElement<any> | string | null);
|
||||
tabBarVisible?: boolean;
|
||||
tabBarTestIDProps?: { testID?: string; accessibilityLabel?: string };
|
||||
}
|
||||
@@ -606,21 +624,25 @@ declare module 'react-navigation' {
|
||||
|
||||
export type DrawerLockMode = 'unlocked' | 'locked-closed' | 'locked-open';
|
||||
|
||||
export interface DrawerIconProps {
|
||||
tintColor: string | null;
|
||||
focused: boolean;
|
||||
}
|
||||
|
||||
export interface DrawerLabelProps {
|
||||
tintColor: string | null;
|
||||
focused: boolean;
|
||||
}
|
||||
|
||||
export interface NavigationDrawerScreenOptions {
|
||||
title?: string;
|
||||
drawerIcon?:
|
||||
| React.ReactElement<any>
|
||||
| ((options: {
|
||||
tintColor: string | null;
|
||||
focused: boolean;
|
||||
}) => React.ReactElement<any> | null);
|
||||
| ((options: DrawerIconProps) => React.ReactElement<any> | null);
|
||||
drawerLabel?:
|
||||
| string
|
||||
| React.ReactElement<any>
|
||||
| ((options: {
|
||||
tintColor: string | null;
|
||||
focused: boolean;
|
||||
}) => React.ReactElement<any> | null);
|
||||
| ((options: DrawerLabelProps) => React.ReactElement<any> | null);
|
||||
drawerLockMode?: DrawerLockMode;
|
||||
}
|
||||
|
||||
@@ -649,7 +671,9 @@ declare module 'react-navigation' {
|
||||
lastState: NavigationState | null | undefined;
|
||||
}
|
||||
|
||||
export type NavigationEventCallback = (payload: NavigationEventPayload) => void;
|
||||
export type NavigationEventCallback = (
|
||||
payload: NavigationEventPayload
|
||||
) => void;
|
||||
|
||||
export interface NavigationEventSubscription {
|
||||
remove: () => void;
|
||||
@@ -721,7 +745,7 @@ declare module 'react-navigation' {
|
||||
export interface NavigationNavigatorProps<O = {}, S = {}> {
|
||||
detached?: boolean;
|
||||
navigation?: NavigationProp<S>;
|
||||
screenProps?: { [key: string]: any };
|
||||
screenProps?: ScreenProps;
|
||||
navigationOptions?: O;
|
||||
}
|
||||
|
||||
@@ -776,7 +800,7 @@ declare module 'react-navigation' {
|
||||
scene: NavigationScene;
|
||||
index: number;
|
||||
|
||||
screenProps?: { [key: string]: any };
|
||||
screenProps?: ScreenProps;
|
||||
}
|
||||
|
||||
// The scene renderer props are nearly identical to the props used for rendering
|
||||
@@ -832,6 +856,7 @@ declare module 'react-navigation' {
|
||||
ModalSlideFromBottomIOS: TransitionConfig;
|
||||
FadeInFromBottomAndroid: TransitionConfig;
|
||||
FadeOutToBottomAndroid: TransitionConfig;
|
||||
NoAnimation: TransitionConfig;
|
||||
}
|
||||
|
||||
export const StackViewTransitionConfigs: StackViewTransitionConfigsType;
|
||||
@@ -866,15 +891,29 @@ declare module 'react-navigation' {
|
||||
|
||||
export interface NavigationContainerProps<S = {}, O = {}> {
|
||||
uriPrefix?: string | RegExp;
|
||||
/**
|
||||
* Controls whether the navigation container handles URLs opened via 'Linking'
|
||||
* @see https://facebook.github.io/react-native/docs/linking
|
||||
* @see https://reactnavigation.org/docs/en/deep-linking.html
|
||||
*/
|
||||
enableURLHandling?: boolean; // defaults to true
|
||||
onNavigationStateChange?: (
|
||||
prevNavigationState: NavigationState,
|
||||
nextNavigationState: NavigationState,
|
||||
action: NavigationAction
|
||||
) => void | null | undefined;
|
||||
navigation?: NavigationScreenProp<S>;
|
||||
/*
|
||||
* This prop is no longer supported. Use `loadNavigationState` and
|
||||
* `persistNavigationState` instead.
|
||||
*/
|
||||
persistenceKey?: string | null;
|
||||
|
||||
loadNavigationState?: () => Promise<any>;
|
||||
persistNavigationState?: (state: NavigationState) => Promise<any>;
|
||||
|
||||
renderLoadingExperimental?: React.ComponentType;
|
||||
screenProps?: any;
|
||||
screenProps?: ScreenProps;
|
||||
navigationOptions?: O;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
}
|
||||
@@ -896,7 +935,7 @@ declare module 'react-navigation' {
|
||||
): NavigationContainerComponent;
|
||||
|
||||
router: NavigationRouter<any, any>;
|
||||
screenProps: { [key: string]: any };
|
||||
screenProps: ScreenProps;
|
||||
navigationOptions: any;
|
||||
state: { nav: NavigationState | null };
|
||||
}
|
||||
@@ -907,12 +946,6 @@ declare module 'react-navigation' {
|
||||
containerOptions?: any;
|
||||
}
|
||||
|
||||
// Return createNavigationContainer
|
||||
export function StackNavigator(
|
||||
routeConfigMap: NavigationRouteConfigMap,
|
||||
stackConfig?: StackNavigatorConfig
|
||||
): NavigationContainer;
|
||||
|
||||
export function createStackNavigator(
|
||||
routeConfigMap: NavigationRouteConfigMap,
|
||||
stackConfig?: StackNavigatorConfig
|
||||
@@ -928,11 +961,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
|
||||
@@ -994,7 +1022,11 @@ declare module 'react-navigation' {
|
||||
style?: StyleProp<ViewStyle>;
|
||||
labelStyle?: StyleProp<TextStyle>;
|
||||
};
|
||||
drawerType?: 'front' | 'back' | 'slide';
|
||||
drawerLockMode?: DrawerLockMode;
|
||||
edgeWidth?: number;
|
||||
hideStatusBar?: boolean;
|
||||
overlayColor?: string;
|
||||
}
|
||||
|
||||
export function DrawerNavigator(
|
||||
@@ -1039,33 +1071,27 @@ declare module 'react-navigation' {
|
||||
lazy?: boolean;
|
||||
}
|
||||
|
||||
export interface InitialLayout {
|
||||
height: number;
|
||||
width: number;
|
||||
}
|
||||
|
||||
// From navigators/TabNavigator.js
|
||||
export interface TabNavigatorConfig
|
||||
extends NavigationTabRouterConfig,
|
||||
TabViewConfig {
|
||||
lazy?: boolean;
|
||||
removeClippedSubviews?: boolean;
|
||||
initialLayout?: { height: number; width: number };
|
||||
initialLayout?: InitialLayout;
|
||||
}
|
||||
export interface BottomTabNavigatorConfig
|
||||
extends NavigationBottomTabRouterConfig,
|
||||
TabViewConfig {
|
||||
lazy?: boolean;
|
||||
removeClippedSubviews?: boolean;
|
||||
initialLayout?: { height: number; width: number };
|
||||
initialLayout?: InitialLayout;
|
||||
}
|
||||
|
||||
// From navigators/TabNavigator.js
|
||||
export function TabNavigator(
|
||||
routeConfigMap: NavigationRouteConfigMap,
|
||||
drawConfig?: TabNavigatorConfig
|
||||
): NavigationContainer;
|
||||
|
||||
export function createTabNavigator(
|
||||
routeConfigMap: NavigationRouteConfigMap,
|
||||
drawConfig?: TabNavigatorConfig
|
||||
): NavigationContainer;
|
||||
|
||||
export function createBottomTabNavigator(
|
||||
routeConfigMap: NavigationRouteConfigMap,
|
||||
drawConfig?: BottomTabNavigatorConfig
|
||||
@@ -1076,7 +1102,7 @@ declare module 'react-navigation' {
|
||||
drawConfig?: TabNavigatorConfig
|
||||
): NavigationContainer;
|
||||
|
||||
export interface TabBarTopProps {
|
||||
export interface MaterialTopTabBarProps {
|
||||
activeTintColor: string;
|
||||
inactiveTintColor: string;
|
||||
indicatorStyle: StyleProp<ViewStyle>;
|
||||
@@ -1088,7 +1114,7 @@ declare module 'react-navigation' {
|
||||
tabBarPosition: string;
|
||||
navigation: NavigationScreenProp<NavigationState>;
|
||||
jumpToIndex: (index: number) => void;
|
||||
getLabel: (scene: TabScene) => React.ReactNode | string;
|
||||
getLabelText: (scene: TabScene) => React.ReactNode | string;
|
||||
getOnPress: (
|
||||
previousScene: NavigationRoute,
|
||||
scene: TabScene
|
||||
@@ -1102,7 +1128,7 @@ declare module 'react-navigation' {
|
||||
iconStyle?: ViewStyle;
|
||||
}
|
||||
|
||||
export interface TabBarBottomProps {
|
||||
export interface BottomTabBarProps {
|
||||
activeTintColor: string;
|
||||
activeBackgroundColor: string;
|
||||
adaptive?: boolean;
|
||||
@@ -1113,7 +1139,7 @@ declare module 'react-navigation' {
|
||||
position: AnimatedValue;
|
||||
navigation: NavigationScreenProp<NavigationState>;
|
||||
jumpToIndex: (index: number) => void;
|
||||
getLabel: (scene: TabScene) => React.ReactNode | string;
|
||||
getLabelText: (scene: TabScene) => React.ReactNode | string;
|
||||
getOnPress: (
|
||||
previousScene: NavigationRoute,
|
||||
scene: TabScene
|
||||
@@ -1129,10 +1155,16 @@ declare module 'react-navigation' {
|
||||
labelStyle?: TextStyle;
|
||||
tabStyle?: ViewStyle;
|
||||
showIcon?: boolean;
|
||||
safeAreaInset?: {
|
||||
top?: SafeAreaViewForceInsetValue;
|
||||
bottom?: SafeAreaViewForceInsetValue;
|
||||
left?: SafeAreaViewForceInsetValue;
|
||||
right?: SafeAreaViewForceInsetValue;
|
||||
};
|
||||
}
|
||||
|
||||
export const TabBarTop: React.ComponentType<TabBarTopProps>;
|
||||
export const TabBarBottom: React.ComponentType<TabBarBottomProps>;
|
||||
export const MaterialTopTabBar: React.ComponentType<MaterialTopTabBarProps>;
|
||||
export const BottomTabBar: React.ComponentType<BottomTabBarProps>;
|
||||
|
||||
/**
|
||||
* NavigationActions
|
||||
@@ -1183,7 +1215,9 @@ declare module 'react-navigation' {
|
||||
): NavigationPopToTopAction;
|
||||
|
||||
function push(options: NavigationPushActionPayload): NavigationPushAction;
|
||||
function reset(options: NavigationResetActionPayload): NavigationResetAction;
|
||||
function reset(
|
||||
options: NavigationResetActionPayload
|
||||
): NavigationResetAction;
|
||||
|
||||
function replace(
|
||||
options: NavigationReplaceActionPayload
|
||||
@@ -1269,7 +1303,7 @@ declare module 'react-navigation' {
|
||||
{
|
||||
descriptors: { [key: string]: NavigationDescriptor };
|
||||
navigationConfig: O;
|
||||
screenProps?: { [key: string]: any };
|
||||
screenProps?: ScreenProps;
|
||||
} & NavigationInjectedProps
|
||||
>;
|
||||
|
||||
@@ -1314,7 +1348,7 @@ declare module 'react-navigation' {
|
||||
Options = any
|
||||
> {
|
||||
navigation: NavigationScreenProp<NavigationRoute<Params>, Params>;
|
||||
screenProps?: { [key: string]: any };
|
||||
screenProps?: ScreenProps;
|
||||
navigationOptions?: NavigationScreenConfig<Options>;
|
||||
}
|
||||
|
||||
@@ -1331,11 +1365,12 @@ declare module 'react-navigation' {
|
||||
export interface HeaderBackButtonProps {
|
||||
onPress?: () => void;
|
||||
pressColorAndroid?: string;
|
||||
title?: string;
|
||||
title?: string | null;
|
||||
titleStyle?: StyleProp<TextStyle>;
|
||||
tintColor?: string;
|
||||
truncatedTitle?: string;
|
||||
width?: number;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export const HeaderBackButton: React.ComponentClass<HeaderBackButtonProps>;
|
||||
@@ -1352,6 +1387,14 @@ declare module 'react-navigation' {
|
||||
T extends React.ComponentType<any>
|
||||
> = T extends React.ComponentType<infer P> ? P : never;
|
||||
|
||||
export interface NavigationOrientationInjectedProps {
|
||||
isLandscape: boolean;
|
||||
}
|
||||
|
||||
export function withOrientation<P extends NavigationOrientationInjectedProps>(
|
||||
Component: React.ComponentType<P>
|
||||
): React.ComponentType<Omit<P, keyof NavigationOrientationInjectedProps>>;
|
||||
|
||||
export interface NavigationInjectedProps<P = NavigationParams> {
|
||||
navigation: NavigationScreenProp<NavigationRoute<P>, P>;
|
||||
}
|
||||
@@ -1426,4 +1469,24 @@ declare module 'react-navigation' {
|
||||
}
|
||||
|
||||
export const SafeAreaView: React.ComponentClass<SafeAreaViewProps>;
|
||||
|
||||
export const NavigationContext: React.Context<
|
||||
NavigationScreenProp<NavigationRoute>
|
||||
>;
|
||||
export const StackGestureContext: React.Context<React.Ref<PanGestureHandler>>;
|
||||
export const DrawerGestureContext: React.Context<
|
||||
React.Ref<PanGestureHandler>
|
||||
>;
|
||||
|
||||
/**
|
||||
* SceneView
|
||||
*/
|
||||
|
||||
export interface SceneViewProps {
|
||||
component: React.ComponentType;
|
||||
screenProps: ScreenProps;
|
||||
navigation: NavigationScreenProp<NavigationRoute>;
|
||||
}
|
||||
|
||||
export class SceneView extends React.Component {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user