Compare commits

..

33 Commits

Author SHA1 Message Date
satyajit.happy
8e57aae5cf chore: release 3.9.2 2019-05-15 11:24:45 +02:00
satyajit.happy
b464e15718 chore: upgrade react-navigation-tabs 2019-05-15 11:23:25 +02:00
Seth
a874d5774c Add resetOnBlur type (#5868)
* Add resetOnBlur type

* Move resetOnBlur to correct interface

* Revert mistaken change to interface name
2019-05-08 11:57:52 -07:00
Luong Dang Hai
96cb00b5a6 correct getLabel to getLabelText (#5865)
* correct getLabel to getLabelText

* Update CHANGELOG.md
2019-05-02 18:53:08 -07:00
Tianyu Xie
9a8a34636d Update react-navigation.d.ts (#5860)
* Update react-navigation.d.ts

* Update CHANGELOG.md
2019-04-30 13:38:25 -07:00
Isaac Clements
950d5ef6d2 TabBarTop is MaterialTopTabBar now (#5856) 2019-04-29 16:54:51 -07:00
satyajit.happy
542122794a chore: release 3.9.1 2019-04-25 10:58:46 +02:00
satyajit.happy
4c81fbefc3 chore: update react-navigation-core 2019-04-25 10:58:30 +02:00
Brent Vatne
bd2daa809f Release 3.9.0 2019-04-23 11:55:40 -07:00
mlodato517
5e07cd2601 Removes duplicate NavigationInjectedProps export (#5828) 2019-04-18 18:13:18 -07:00
Ashoat Tevosyan
cd22810be6 [flow] Fix NavigationScreenProp.getParam type (#5830)
In my last PR I flipped the order of these around to fix an error, but turns out that was just crippling the type. The correct solution here, to guarantee that the `$PropertyType` won't error if its type parameter don't have the property, is to use an unsealed object type.

Some additional context in discussion on #5806.
2019-04-18 18:12:31 -07:00
Edmundo Santos
3f8a4d491c Add missing types for DrawerNavigatorConfig (#5820) 2019-04-17 11:28:25 -07:00
Luong Dang Hai
837fc0bc25 chore: remove createTabNavigator out of ts definition (#5809)
* chore: remove createTabNavigator out of ts definition

* update change log file
2019-04-13 12:57:01 -07:00
Brent Vatne
57d2bbeb96 Release 3.8.1 2019-04-12 15:39:19 -07:00
Brent Vatne
e3c38aefe8 Release 3.8.0 2019-04-12 15:37:54 -07:00
Ashoat Tevosyan
fb7da05beb [flow] Update for Flow 0.92 (#5806)
Changes:

1. We can now type React components with static members as `React.ComponentType` (instead of requiring the `StatelessFunctionalComponent`) hack.
2. We can now type-parameterize React components on all of their props, instead of just the ones we care about. Not sure why this wasn't previously. Note: this is a breaking change, in the sense that people's parameterization of `NavigationScreenComponent`, `NavigationNavigator`, and `NavigationContainer` may need to change.
3. The order of object-type-spread in the `getParam` definition has been switched. It was giving errors with the old order.
4. Avoid recursive type inference `NavigationScreenProp`. This was yielding an "*** Recursion limit exceeded ***" error, which was rather difficult to debug. We can just use a `NavigationState` and let the user cast.
5. Fix `onTransitionStart`/`onTransitionEnd` types in `NavigationStackViewConfig`.
6. Add `navigationConfig` property to `NavigationView`.
2019-04-12 09:31:44 -07:00
jeffreyffs
5d097b92f4 [Typescript] Add type for 'enableURLHandling' (#5803)
* updated types for 'enableURLHandling'

* Updated Changelog
2019-04-10 17:11:32 -07:00
Brent Vatne
60618d5d1d Release 3.7.1
- Rename 3.7.0 to 3.7.1 basically because I needed to rebase
2019-04-10 11:19:50 -07:00
Brent Vatne
28e1753434 Release 3.7.0 2019-04-10 11:18:13 -07:00
guptaamol
48b1bd965b Improved TypeScript definition for bottom tab navigationOptions. (#5796) 2019-04-10 10:35:16 -07:00
Brent Vatne
6e80d7c75a Update dependencies and lockfile 2019-04-10 10:25:44 -07:00
Ashoat Tevosyan
1c75f17a86 [flow] Fix TabBar types (#5800)
1. `TabBarTop` is `MaterialTopTabBar` now
2. `MaterialTopTabBar` does not have a `getButtonComponent` prop (accidentally added in #5648)
3. `BottomTabBar`'s `getButtonComponent` prop is a `React.Component`, not a `React.Node`
2019-04-10 09:35:52 -07:00
Ashoat Tevosyan
e542c84e29 [flow] Support custom navigators using Transitioner (#5801) 2019-04-10 09:35:30 -07:00
zzzgit
a7265155bd grammar error (#5768) 2019-04-05 12:45:48 +02:00
Brent Vatne
69e40950b1 Release 3.6.1 2019-04-02 14:17:27 +02:00
Brent Vatne
3deec699ee Release 3.6.0 2019-03-31 15:40:19 +02:00
Brent Vatne
2c875e39ae Add types for back button disabled and NoAnimation transition config 2019-03-31 15:31:40 +02:00
Faustino Kialungila
8788dd77b4 Adding missing getButtonComponent props to flow (#5648) 2019-03-27 17:01:48 -07:00
Jose G
71cb16dc7f chore(typescript): export InitialLayout type (#5738) 2019-03-26 16:14:32 -07:00
alex clifton
445dcfcdf2 unhandled promise rejection failed to delete storage directory (#5727)
with:

await AsyncStorage.clear();

I'm getting this in ios:

unhandled promise rejection failed to delete storage directory

found this:

https://stackoverflow.com/questions/46736268/react-native-asyncstorage-clear-is-failing-on-ios

switched to use this instead:

await AsyncStorage.getAllKeys().then(AsyncStorage.multiRemove)

but that causes unhandled promise rejection in android.

this is working:

Platform.OS === 'ios' ? await AsyncStorage.getAllKeys().then(AsyncStorage.multiRemove) : await AsyncStorage.clear()
2019-03-22 11:13:05 -07:00
Jose G
ec97b610c5 chore(typescript): export ScreenProps (#5726) 2019-03-22 11:11:05 -07:00
Jose G
b9f50bd012 [TypeScript] Export DrawerIconProps and DrawerLabelProps (#5715)
* chore(typescript): export DrawerIconProps and DrawerLabelProps

* chore: update changelog
2019-03-20 19:28:36 -07:00
Jose G
dbf165dbe7 chore(typescript): export "TabBarIconProps" and "TabBarLabelProps" (#5712) 2019-03-20 10:02:12 -07:00
9 changed files with 1214 additions and 1145 deletions

View File

@@ -7,6 +7,70 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
- Update typescript with headerLeftContainerStyle and headerRightContainerStyle
## Fixes
- Update typescript - `TabBarTop` is now `MaterialTopTabBar`
- 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)
## 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
@@ -18,7 +82,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- 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
@@ -201,8 +264,14 @@ 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.5.1...HEAD
[3.5.0]: https://github.com/react-navigation/react-navigation/compare/3.5.0...3.5.1
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/3.9.0...HEAD
[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

View File

@@ -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?

View File

@@ -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');
};
}

View File

@@ -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

View File

@@ -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) => {},
@@ -460,16 +456,22 @@ declare module 'react-navigation' {
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 +588,7 @@ declare module 'react-navigation' {
fallback?: $ElementType<
$PropertyType<
{|
...{| params: {| [ParamName]: void |} |},
...{| params: {} |},
...$Exact<S>,
|},
'params'
@@ -596,14 +598,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 +660,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 +671,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 +710,7 @@ declare module 'react-navigation' {
isStale: boolean,
key: string,
route: NavigationRoute,
descriptor: ?NavigationDescriptor,
};
declare export type NavigationTransitionProps = $Shape<{
@@ -920,9 +922,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 +932,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 +1040,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 +1113,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 +1181,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,8 +1205,17 @@ declare module 'react-navigation' {
labelStyle?: TextStyleProp,
iconStyle?: ViewStyleProp,
};
declare export var TabBarTop: React$ComponentType<_TabBarTopProps>;
declare export var MaterialTopTabBar: React$ComponentType<
_MaterialTopTabBarProps
>;
declare type _BottomTabBarButtonComponentProps = {
onPress: () => void,
onLongPress: () => void,
testID: string,
accessibilityLabel: string,
style: ViewStyleProp,
};
declare type _BottomTabBarProps = {
activeTintColor: string,
activeBackgroundColor: string,
@@ -1223,6 +1239,9 @@ 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,

View File

@@ -1,6 +1,6 @@
{
"name": "react-navigation",
"version": "3.5.1",
"version": "3.9.2",
"description": "Routing and navigation for your React Native apps",
"main": "src/react-navigation.js",
"types": "typescript/react-navigation.d.ts",
@@ -36,11 +36,11 @@
"react-native": "*"
},
"dependencies": {
"@react-navigation/core": "3.2.0",
"@react-navigation/native": "~3.3.0",
"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.4.0",
"react-navigation-drawer": "1.2.1",
"react-navigation-stack": "1.3.0",
"react-navigation-tabs": "1.1.3"
},
"devDependencies": {
"@types/react-native": "~0.57.38",
@@ -50,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",

View File

@@ -66,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,
@@ -172,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 = {}> {
@@ -233,7 +237,7 @@ declare module 'react-navigation' {
export interface NavigationScreenConfigProps {
navigation: NavigationScreenProp<NavigationRoute>;
screenProps: { [key: string]: any };
screenProps: ScreenProps;
}
export type NavigationScreenConfig<Options> =
@@ -468,6 +472,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';
@@ -541,18 +547,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;
@@ -560,23 +567,28 @@ 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 };
}
@@ -608,21 +620,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;
}
@@ -723,7 +739,7 @@ declare module 'react-navigation' {
export interface NavigationNavigatorProps<O = {}, S = {}> {
detached?: boolean;
navigation?: NavigationProp<S>;
screenProps?: { [key: string]: any };
screenProps?: ScreenProps;
navigationOptions?: O;
}
@@ -778,7 +794,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
@@ -834,6 +850,7 @@ declare module 'react-navigation' {
ModalSlideFromBottomIOS: TransitionConfig;
FadeInFromBottomAndroid: TransitionConfig;
FadeOutToBottomAndroid: TransitionConfig;
NoAnimation: TransitionConfig;
}
export const StackViewTransitionConfigs: StackViewTransitionConfigsType;
@@ -868,6 +885,12 @@ 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,
@@ -876,7 +899,7 @@ declare module 'react-navigation' {
navigation?: NavigationScreenProp<S>;
persistenceKey?: string | null;
renderLoadingExperimental?: React.ComponentType;
screenProps?: any;
screenProps?: ScreenProps;
navigationOptions?: O;
style?: StyleProp<ViewStyle>;
}
@@ -898,7 +921,7 @@ declare module 'react-navigation' {
): NavigationContainerComponent;
router: NavigationRouter<any, any>;
screenProps: { [key: string]: any };
screenProps: ScreenProps;
navigationOptions: any;
state: { nav: NavigationState | null };
}
@@ -996,7 +1019,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(
@@ -1041,20 +1068,25 @@ 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
@@ -1063,11 +1095,6 @@ declare module 'react-navigation' {
drawConfig?: TabNavigatorConfig
): NavigationContainer;
export function createTabNavigator(
routeConfigMap: NavigationRouteConfigMap,
drawConfig?: TabNavigatorConfig
): NavigationContainer;
export function createBottomTabNavigator(
routeConfigMap: NavigationRouteConfigMap,
drawConfig?: BottomTabNavigatorConfig
@@ -1078,7 +1105,7 @@ declare module 'react-navigation' {
drawConfig?: TabNavigatorConfig
): NavigationContainer;
export interface TabBarTopProps {
export interface MaterialTopTabBarProps {
activeTintColor: string;
inactiveTintColor: string;
indicatorStyle: StyleProp<ViewStyle>;
@@ -1090,7 +1117,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
@@ -1115,7 +1142,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
@@ -1133,7 +1160,7 @@ declare module 'react-navigation' {
showIcon?: boolean;
}
export const TabBarTop: React.ComponentType<TabBarTopProps>;
export const MaterialTopTabBar: React.ComponentType<MaterialTopTabBarProps>;
export const BottomTabBar: React.ComponentType<BottomTabBarProps>;
/**
@@ -1271,7 +1298,7 @@ declare module 'react-navigation' {
{
descriptors: { [key: string]: NavigationDescriptor };
navigationConfig: O;
screenProps?: { [key: string]: any };
screenProps?: ScreenProps;
} & NavigationInjectedProps
>;
@@ -1316,7 +1343,7 @@ declare module 'react-navigation' {
Options = any
> {
navigation: NavigationScreenProp<NavigationRoute<Params>, Params>;
screenProps?: { [key: string]: any };
screenProps?: ScreenProps;
navigationOptions?: NavigationScreenConfig<Options>;
}
@@ -1338,6 +1365,7 @@ declare module 'react-navigation' {
tintColor?: string;
truncatedTitle?: string;
width?: number;
disabled?: boolean;
}
export const HeaderBackButton: React.ComponentClass<HeaderBackButtonProps>;
@@ -1366,10 +1394,6 @@ declare module 'react-navigation' {
navigation: NavigationScreenProp<NavigationRoute<P>, P>;
}
export interface NavigationInjectedProps<P = NavigationParams> {
navigation: NavigationScreenProp<NavigationRoute<P>, P>;
}
// If the wrapped component is a class, we can get a ref to it
export function withNavigation<
P extends NavigationInjectedProps,

1475
yarn.lock

File diff suppressed because it is too large Load Diff