From 9ab3cd0e77531269fc92e44a169b6c45ee794f69 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Mon, 3 Feb 2020 01:00:51 +0100 Subject: [PATCH] feat: sync latest stack --- example/package.json | 2 +- example/yarn.lock | 32 +- package.json | 4 +- scripts/stack.patch | 136 ++++--- .../NestedNavigator.test.tsx.snap | 376 +++++++++--------- .../StackNavigator.test.tsx.snap | 30 +- yarn.lock | 71 ++-- 7 files changed, 360 insertions(+), 291 deletions(-) diff --git a/example/package.json b/example/package.json index bbe65ed7e..27ca0d0a5 100644 --- a/example/package.json +++ b/example/package.json @@ -17,7 +17,7 @@ "react": "16.9.0", "react-dom": "16.9.0", "react-native": "0.61.4", - "react-native-gesture-handler": "~1.5.0", + "react-native-gesture-handler": "^1.5.5", "react-native-iphone-x-helper": "^1.2.1", "react-native-maps": "0.26.1", "react-native-paper": "^2.15.2", diff --git a/example/yarn.lock b/example/yarn.lock index 1cf51c637..572e7adc7 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -1291,6 +1291,13 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@egjs/hammerjs@^2.0.17": + version "2.0.17" + resolved "https://registry.yarnpkg.com/@egjs/hammerjs/-/hammerjs-2.0.17.tgz#5dc02af75a6a06e4c2db0202cae38c9263895124" + integrity sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A== + dependencies: + "@types/hammerjs" "^2.0.36" + "@expo/bunyan@3.0.2": version "3.0.2" resolved "https://registry.yarnpkg.com/@expo/bunyan/-/bunyan-3.0.2.tgz#775680bd479a8b79ada4a5676936a58eef1579c9" @@ -1916,6 +1923,11 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/hammerjs@^2.0.36": + version "2.0.36" + resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.36.tgz#17ce0a235e9ffbcdcdf5095646b374c2bf615a4c" + integrity sha512-7TUK/k2/QGpEAv/BCwSHlYu3NXZhQ9ZwBYpzr9tjlPIL2C5BeGhH3DmVavRx3ZNyELX5TLC91JTz/cen6AAtIQ== + "@types/http-proxy-middleware@*": version "0.19.3" resolved "https://registry.yarnpkg.com/@types/http-proxy-middleware/-/http-proxy-middleware-0.19.3.tgz#b2eb96fbc0f9ac7250b5d9c4c53aade049497d03" @@ -6110,10 +6122,11 @@ gzip-size@5.1.1, gzip-size@^5.0.0: duplexer "^0.1.1" pify "^4.0.1" -hammerjs@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/hammerjs/-/hammerjs-2.0.8.tgz#04ef77862cff2bb79d30f7692095930222bf60f1" - integrity sha1-BO93hiz/K7edMPdpIJWTAiK/YPE= +"hammerjs@git+https://github.com/naver/hammer.js.git": + version "2.0.17-snapshot" + resolved "git+https://github.com/naver/hammer.js.git#54bc698b25edd6e1b76ca975ebaced5ce0467d51" + dependencies: + "@types/hammerjs" "^2.0.36" handle-thing@^2.0.0: version "2.0.0" @@ -9958,12 +9971,13 @@ react-lifecycles-compat@^3.0.4: resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== -react-native-gesture-handler@~1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.5.2.tgz#281111550bf1eee10b7feba5278d142169892731" - integrity sha512-Xp03dq4XYVTD0xmWx4DW4eX+ox1NQLjHmbykspTdS5FCNIVIOekVXRLFCw1698/v8dYUHApNo6K3s3BCD8fqPA== +react-native-gesture-handler@^1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.5.5.tgz#513d6d65c4e24efd6d69be0006c7cd3bc9045358" + integrity sha512-viypCSRpo064BdpkVL2FnPLZiEK3piJ1WZxydFXgeZj+avJxd6VnTFoh9+IDFk2M0Eadoy6D1ZV1TqBMGHtqGg== dependencies: - hammerjs "^2.0.8" + "@egjs/hammerjs" "^2.0.17" + hammerjs "https://github.com/naver/hammer.js.git" hoist-non-react-statics "^2.3.1" invariant "^2.2.4" prop-types "^15.7.2" diff --git a/package.json b/package.json index 77be4f8d2..a86e9d907 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@expo/vector-icons": "^10.0.6", "@react-native-community/bob": "^0.7.0", "@react-native-community/masked-view": "^0.1.5", - "@react-navigation/stack": "^5.0.0-alpha.62", + "@react-navigation/stack": "^5.0.0-alpha.66", "@release-it/conventional-changelog": "^1.1.0", "@types/color": "^3.0.1", "@types/jest": "^24.0.25", @@ -67,7 +67,7 @@ "react": "~16.9.0", "react-dom": "~16.9.0", "react-native": "~0.61.4", - "react-native-gesture-handler": "^1.5.3", + "react-native-gesture-handler": "^1.5.5", "react-native-safe-area-context": "^0.6.2", "react-native-screens": "^2.0.0-alpha.22", "react-navigation": "^4.0.10", diff --git a/scripts/stack.patch b/scripts/stack.patch index eb20cb840..e40eaf4c8 100644 --- a/scripts/stack.patch +++ b/scripts/stack.patch @@ -1,6 +1,6 @@ diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.tsx ---- node_modules/@react-navigation/stack/src/index.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/index.tsx 2020-01-23 12:43:56.000000000 +0100 +--- node_modules/@react-navigation/stack/src/index.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/index.tsx 2020-02-03 00:52:58.000000000 +0100 @@ -3,11 +3,6 @@ import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs'; import * as TransitionPresets from './TransitionConfigs/TransitionPresets'; @@ -28,7 +28,7 @@ diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.t StackHeaderTitleProps, StackCardInterpolatedStyle, diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx src/vendor/navigators/createStackNavigator.tsx ---- node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-01-23 12:34:48.000000000 +0100 +--- node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-02-03 00:46:19.000000000 +0100 +++ src/vendor/navigators/createStackNavigator.tsx 1970-01-01 01:00:00.000000000 +0100 @@ -1,81 +0,0 @@ -import * as React from 'react'; @@ -113,9 +113,9 @@ diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNaviga - typeof StackNavigator ->(StackNavigator); diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.tsx ---- node_modules/@react-navigation/stack/src/types.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/types.tsx 2020-01-23 12:43:56.000000000 +0100 -@@ -8,13 +8,28 @@ +--- node_modules/@react-navigation/stack/src/types.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/types.tsx 2020-02-03 00:52:58.000000000 +0100 +@@ -7,13 +7,28 @@ } from 'react-native'; import { EdgeInsets } from 'react-native-safe-area-context'; import { @@ -150,7 +150,7 @@ diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.t export type StackNavigationEventMap = { /** -@@ -27,42 +42,29 @@ +@@ -26,42 +41,29 @@ transitionEnd: { data: { closing: boolean } }; }; @@ -214,7 +214,7 @@ diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.t }; export type Layout = { width: number; height: number }; -@@ -238,24 +240,27 @@ +@@ -237,24 +239,27 @@ /** * Navigation prop for the header. */ @@ -249,7 +249,7 @@ diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.t export type StackNavigationOptions = StackHeaderOptions & Partial & { /** -@@ -328,6 +333,8 @@ +@@ -332,6 +337,8 @@ bottom?: number; left?: number; }; @@ -259,8 +259,8 @@ diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.t export type StackNavigationConfig = { diff -Naur node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/vendor/views/Header/Header.tsx ---- node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Header/Header.tsx 2020-01-23 12:43:56.000000000 +0100 +--- node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Header/Header.tsx 2020-02-03 00:52:58.000000000 +0100 @@ -1,11 +1,13 @@ import * as React from 'react'; -import { StackActions } from '@react-navigation/routers'; @@ -329,8 +329,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/ + +export default Header; diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx src/vendor/views/Header/HeaderBackButton.tsx ---- node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-01-23 12:43:56.000000000 +0100 +--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Header/HeaderBackButton.tsx 2020-02-03 00:52:58.000000000 +0100 @@ -8,9 +8,9 @@ StyleSheet, LayoutChangeEvent, @@ -343,8 +343,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackButto type Props = StackHeaderLeftButtonProps; diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx src/vendor/views/Header/HeaderBackground.tsx ---- node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Header/HeaderBackground.tsx 2020-01-23 12:43:56.000000000 +0100 +--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Header/HeaderBackground.tsx 2020-02-03 00:52:58.000000000 +0100 @@ -1,6 +1,6 @@ import * as React from 'react'; import { Animated, StyleSheet, Platform, ViewProps } from 'react-native'; @@ -354,9 +354,9 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackgroun type Props = ViewProps & { children?: React.ReactNode; diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx src/vendor/views/Header/HeaderContainer.tsx ---- node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Header/HeaderContainer.tsx 2020-01-23 12:43:56.000000000 +0100 -@@ -1,11 +1,7 @@ +--- node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Header/HeaderContainer.tsx 2020-02-03 00:53:51.000000000 +0100 +@@ -1,10 +1,6 @@ import * as React from 'react'; import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native'; -import { @@ -364,13 +364,11 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer - Route, - ParamListBase, -} from '@react-navigation/native'; --import { StackNavigationState } from '@react-navigation/routers'; +import { NavigationContext } from 'react-navigation'; -+import { NavigationState as StackNavigationState } from 'react-navigation'; import { EdgeInsets } from 'react-native-safe-area-context'; import Header from './Header'; -@@ -16,6 +12,7 @@ +@@ -15,6 +11,7 @@ forSlideRight, } from '../../TransitionConfigs/HeaderStyleInterpolators'; import { @@ -378,7 +376,7 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer Layout, Scene, StackHeaderStyleInterpolator, -@@ -99,9 +96,7 @@ +@@ -98,9 +95,7 @@ insets, scene, previous, @@ -390,8 +388,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer mode === 'float' ? isHeaderStatic diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx src/vendor/views/Header/HeaderSegment.tsx ---- node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Header/HeaderSegment.tsx 2020-01-23 12:43:56.000000000 +0100 +--- node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Header/HeaderSegment.tsx 2020-02-03 00:52:58.000000000 +0100 @@ -8,7 +8,7 @@ ViewStyle, } from 'react-native'; @@ -411,8 +409,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.t }; diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx src/vendor/views/Header/HeaderTitle.tsx ---- node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Header/HeaderTitle.tsx 2020-01-23 12:43:56.000000000 +0100 +--- node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Header/HeaderTitle.tsx 2020-02-03 00:52:58.000000000 +0100 @@ -1,6 +1,6 @@ import * as React from 'react'; import { Animated, StyleSheet, Platform, TextProps } from 'react-native'; @@ -422,26 +420,34 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx type Props = TextProps & { tintColor?: string; diff -Naur node_modules/@react-navigation/stack/src/views/Stack/Card.tsx src/vendor/views/Stack/Card.tsx ---- node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Stack/Card.tsx 2020-01-23 12:43:56.000000000 +0100 -@@ -485,7 +485,7 @@ - pointerEvents="none" - /> +--- node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Stack/Card.tsx 2020-02-03 00:56:15.000000000 +0100 +@@ -133,7 +133,7 @@ + + private interactionHandle: number | undefined; + +- private pendingGestureCallback: number | undefined; ++ private pendingGestureCallback: any; + + private animate = ({ + closing, +@@ -507,7 +507,7 @@ ) : null} -- -+ + - {children} diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx src/vendor/views/Stack/CardContainer.tsx ---- node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Stack/CardContainer.tsx 2020-01-23 12:43:56.000000000 +0100 -@@ -1,11 +1,17 @@ - import * as React from 'react'; - import { Animated, View, StyleSheet, StyleProp, ViewStyle } from 'react-native'; --import { StackNavigationState } from '@react-navigation/routers'; +--- node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Stack/CardContainer.tsx 2020-02-03 00:54:36.000000000 +0100 +@@ -7,11 +7,17 @@ + ViewStyle, + Platform, + } from 'react-native'; -import { Route, useTheme } from '@react-navigation/native'; -+import { NavigationState as StackNavigationState } from 'react-navigation'; import { Props as HeaderContainerProps } from '../Header/HeaderContainer'; import Card from './Card'; import HeaderHeightContext from '../../utils/HeaderHeightContext'; @@ -457,7 +463,7 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardContainer.ts type Props = TransitionPreset & { index: number; -@@ -158,7 +164,7 @@ +@@ -187,7 +193,7 @@ ? { marginTop: headerHeight } : null } @@ -467,8 +473,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardContainer.ts > diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx src/vendor/views/Stack/CardStack.tsx ---- node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Stack/CardStack.tsx 2020-01-23 12:44:26.000000000 +0100 +--- node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Stack/CardStack.tsx 2020-02-03 00:52:58.000000000 +0100 @@ -11,8 +11,7 @@ import { EdgeInsets } from 'react-native-safe-area-context'; // eslint-disable-next-line import/no-unresolved @@ -487,7 +493,7 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx sr Layout, StackHeaderMode, StackCardMode, -@@ -96,7 +96,7 @@ +@@ -104,7 +104,7 @@ ); diff -Naur node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx src/vendor/views/Stack/StackView.tsx ---- node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-01-23 12:34:48.000000000 +0100 -+++ src/vendor/views/Stack/StackView.tsx 2020-01-23 12:43:56.000000000 +0100 -@@ -1,8 +1,11 @@ +--- node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-02-03 00:46:19.000000000 +0100 ++++ src/vendor/views/Stack/StackView.tsx 2020-02-03 00:55:11.000000000 +0100 +@@ -1,9 +1,11 @@ import * as React from 'react'; - import { Platform } from 'react-native'; + import { View, Platform, StyleSheet } from 'react-native'; import { SafeAreaConsumer, EdgeInsets } from 'react-native-safe-area-context'; +-import { GestureHandlerRootView } from 'react-native-gesture-handler'; -import { Route } from '@react-navigation/native'; -import { StackActions, StackNavigationState } from '@react-navigation/routers'; -+import { -+ StackActions, -+ NavigationState as StackNavigationState, -+ SceneView, -+} from 'react-navigation'; ++import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { ++ StackActions, ++ NavigationState as StackNavigationState, ++ SceneView, ++ } from 'react-navigation'; import CardStack from './CardStack'; import KeyboardManager from '../KeyboardManager'; -@@ -11,6 +14,7 @@ +@@ -12,6 +14,7 @@ } from '../Header/HeaderContainer'; import SafeAreaProviderCompat from '../SafeAreaProviderCompat'; import { @@ -521,7 +528,7 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx sr StackNavigationHelpers, StackNavigationConfig, StackDescriptorMap, -@@ -20,6 +24,7 @@ +@@ -21,6 +24,7 @@ state: StackNavigationState; navigation: StackNavigationHelpers; descriptors: StackDescriptorMap; @@ -529,7 +536,7 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx sr }; type State = { -@@ -257,14 +262,31 @@ +@@ -287,14 +291,31 @@ return null; } @@ -562,7 +569,7 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx sr this.setState(state => ({ routes: state.replacingRouteKeys.length ? state.routes.filter(r => !state.replacingRouteKeys.includes(r.key)) -@@ -282,10 +304,15 @@ +@@ -312,12 +333,17 @@ // If a route exists in state, trigger a pop // This will happen in when the route was closed from the card component // e.g. When the close animation triggered from a gesture ends @@ -570,19 +577,22 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx sr - ...StackActions.pop(), - source: route.key, - target: state.key, +- }); + // @ts-ignore + navigation.dispatch(StackActions.pop({ key: route.key })); -+ } else { + } else { + // While closing route we need to point to the previous one assuming that + // this previous one in routes array + const index = this.state.routes.findIndex(r => r.key === route.key); + + this.handleTransitionComplete({ + route: this.state.routes[Math.max(index - 1, 0)], - }); - } - -@@ -300,22 +327,26 @@ ++ }); ++ + // We need to clean up any state tracking the route and pop it immediately + this.setState(state => ({ + routes: state.routes.filter(r => r.key !== route.key), +@@ -334,22 +360,26 @@ private handleTransitionStart = ( { route }: { route: Route }, closing: boolean diff --git a/src/navigators/__tests__/__snapshots__/NestedNavigator.test.tsx.snap b/src/navigators/__tests__/__snapshots__/NestedNavigator.test.tsx.snap index 0d1fee956..a2f66fd71 100644 --- a/src/navigators/__tests__/__snapshots__/NestedNavigator.test.tsx.snap +++ b/src/navigators/__tests__/__snapshots__/NestedNavigator.test.tsx.snap @@ -1,7 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Nested navigators renders succesfully as direct child 1`] = ` -Array [ + - - - + + > + + - - + + - - - - - + > + + + - - Home - + + Home + + @@ -465,7 +480,7 @@ Array [ - , + - , -] + + `; exports[`Nested navigators throw when trying to pass navigation prop 1`] = `"No \\"routes\\" found in navigation state. Did you try to pass the navigation prop of a React component to a Navigator child? See https://reactnavigation.org/docs/en/custom-navigators.html#navigator-navigation-prop"`; diff --git a/src/navigators/__tests__/__snapshots__/StackNavigator.test.tsx.snap b/src/navigators/__tests__/__snapshots__/StackNavigator.test.tsx.snap index b9dd0ec34..ec9fd3123 100644 --- a/src/navigators/__tests__/__snapshots__/StackNavigator.test.tsx.snap +++ b/src/navigators/__tests__/__snapshots__/StackNavigator.test.tsx.snap @@ -1,7 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`StackNavigator applies correct values when headerRight is present 1`] = ` -Array [ + - , + - , -] + + `; exports[`StackNavigator renders successfully 1`] = ` -Array [ + - , + - , -] + + `; diff --git a/yarn.lock b/yarn.lock index 839c5102c..5b67ad6ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -909,6 +909,13 @@ dependencies: find-up "^4.0.0" +"@egjs/hammerjs@^2.0.17": + version "2.0.17" + resolved "https://registry.yarnpkg.com/@egjs/hammerjs/-/hammerjs-2.0.17.tgz#5dc02af75a6a06e4c2db0202cae38c9263895124" + integrity sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A== + dependencies: + "@types/hammerjs" "^2.0.36" + "@expo/vector-icons@^10.0.6": version "10.0.6" resolved "https://registry.yarnpkg.com/@expo/vector-icons/-/vector-icons-10.0.6.tgz#5718953ff0b97827d11dae5787976fa8ce5caaed" @@ -1369,13 +1376,14 @@ query-string "^6.4.2" react-is "^16.8.6" -"@react-navigation/core@^5.0.0-alpha.36": - version "5.0.0-alpha.36" - resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-5.0.0-alpha.36.tgz#6047cfd2e73aea802800eab68f068764ff3f8d4d" - integrity sha512-VfuUd46N/e4Oe7/cKywy1IIRetXQH9NP58QhxznmMOAG/XCIsD5+EA/nIY0NdRem57A3gnrgVxK83h6/g8mZVw== +"@react-navigation/core@^5.0.0-alpha.40": + version "5.0.0-alpha.40" + resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-5.0.0-alpha.40.tgz#a91cd624c85ff0d02477938229ae2094f6a7e9f2" + integrity sha512-SoxTNW2yL9XL2A5yNDIg8PP8owob2r+T3g4IeBQqVRBJJN8Rp9elfEbPkUmmHyBBYAmc/sxcKHqM+6KwFAfHTQ== dependencies: escape-string-regexp "^2.0.0" query-string "^6.9.0" + react-is "^16.12.0" shortid "^2.2.15" use-subscription "^1.3.0" @@ -1388,20 +1396,20 @@ react-native-safe-area-view "^0.14.1" react-native-screens "^1.0.0 || ^1.0.0-alpha" -"@react-navigation/routers@^5.0.0-alpha.26": - version "5.0.0-alpha.26" - resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-5.0.0-alpha.26.tgz#139c097c55e556c11dcd96e78409165080c3a75b" - integrity sha512-y/Z4dseD0gCrrWA/Frz4+2k2ZMUjXfIdw+Jd+qhXEkcOTGb6NoGujgZndozHsBYZ7zuUwURKhf6vE3lVulAldA== +"@react-navigation/routers@^5.0.0-alpha.30": + version "5.0.0-alpha.30" + resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-5.0.0-alpha.30.tgz#f7ccf09ed70520a0789fabd23074c72a4c87f062" + integrity sha512-ilDhhzlyg0EnjfrZHCzZuOFJoUckK25S1N0y0JFsQuhJMCssqt6qtc0kLg7DPKCn8fPrPnBhex6x3vcgSdF9oA== dependencies: - "@react-navigation/core" "^5.0.0-alpha.36" + "@react-navigation/core" "^5.0.0-alpha.40" shortid "^2.2.15" -"@react-navigation/stack@^5.0.0-alpha.62": - version "5.0.0-alpha.62" - resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.0.0-alpha.62.tgz#fea465ddfe70c150de1d9e03e82ae3e30a572419" - integrity sha512-Bo6y3dD1DODBVLw9Xqcim+nXKHE/mCBmpdeCgFi+3VX5QS2bm+NotbRHz8AQNI8d4w6qWQs8EairfcxlTr11NA== +"@react-navigation/stack@^5.0.0-alpha.66": + version "5.0.0-alpha.66" + resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.0.0-alpha.66.tgz#4eb490dc23e272324241344b2b54179f9c93206c" + integrity sha512-MLdBtTnTASAK4PZzNlnlALbV0uYMA8Q4LBqP83ve768mPw0zCjaSLknugB4W+iW5pbzyMGn++sdIbwBePZtIGA== dependencies: - "@react-navigation/routers" "^5.0.0-alpha.26" + "@react-navigation/routers" "^5.0.0-alpha.30" color "^3.1.2" react-native-iphone-x-helper "^1.2.1" @@ -1499,6 +1507,11 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/hammerjs@^2.0.36": + version "2.0.36" + resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.36.tgz#17ce0a235e9ffbcdcdf5095646b374c2bf615a4c" + integrity sha512-7TUK/k2/QGpEAv/BCwSHlYu3NXZhQ9ZwBYpzr9tjlPIL2C5BeGhH3DmVavRx3ZNyELX5TLC91JTz/cen6AAtIQ== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -4426,10 +4439,11 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -hammerjs@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/hammerjs/-/hammerjs-2.0.8.tgz#04ef77862cff2bb79d30f7692095930222bf60f1" - integrity sha1-BO93hiz/K7edMPdpIJWTAiK/YPE= +"hammerjs@https://github.com/naver/hammer.js.git": + version "2.0.17-snapshot" + resolved "https://github.com/naver/hammer.js.git#54bc698b25edd6e1b76ca975ebaced5ce0467d51" + dependencies: + "@types/hammerjs" "^2.0.36" handlebars@^4.1.0, handlebars@^4.1.2: version "4.1.2" @@ -7579,22 +7593,23 @@ react-dom@~16.9.0: prop-types "^15.6.2" scheduler "^0.15.0" +react-is@^16.12.0, react-is@^16.9.0: + version "16.12.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c" + integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q== + react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6: version "16.8.6" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== -react-is@^16.9.0: - version "16.12.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c" - integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q== - -react-native-gesture-handler@^1.5.3: - version "1.5.3" - resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.5.3.tgz#191b44701fab7ba54c27a2438cb5eaa252666e66" - integrity sha512-y2/jw0uHAQtEPR02PHAah6tdMymrVtZFoHqjlEWdhK807w2sgU5CySYINK/nOTczd+zB4GMX+9euA3VfbGJ5aA== +react-native-gesture-handler@^1.5.5: + version "1.5.5" + resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.5.5.tgz#513d6d65c4e24efd6d69be0006c7cd3bc9045358" + integrity sha512-viypCSRpo064BdpkVL2FnPLZiEK3piJ1WZxydFXgeZj+avJxd6VnTFoh9+IDFk2M0Eadoy6D1ZV1TqBMGHtqGg== dependencies: - hammerjs "^2.0.8" + "@egjs/hammerjs" "^2.0.17" + hammerjs "https://github.com/naver/hammer.js.git" hoist-non-react-statics "^2.3.1" invariant "^2.2.4" prop-types "^15.7.2"