Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit 78fa377

Browse files
committed
chore: sync latest stack
1 parent 4b791cb commit 78fa377

File tree

3 files changed

+57
-60
lines changed

3 files changed

+57
-60
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@expo/vector-icons": "^10.0.6",
5151
"@react-native-community/bob": "^0.7.0",
5252
"@react-native-community/masked-view": "^0.1.5",
53-
"@react-navigation/stack": "^5.0.0-alpha.56",
53+
"@react-navigation/stack": "^5.0.0-alpha.58",
5454
"@release-it/conventional-changelog": "^1.1.0",
5555
"@types/color": "^3.0.1",
5656
"@types/jest": "^24.0.25",

scripts/stack.patch

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.tsx
2-
--- node_modules/@react-navigation/stack/src/index.tsx 2020-01-07 15:54:09.000000000 +0100
3-
+++ src/vendor/index.tsx 2020-01-07 16:06:06.000000000 +0100
2+
--- node_modules/@react-navigation/stack/src/index.tsx 2020-01-09 03:40:24.000000000 +0100
3+
+++ src/vendor/index.tsx 2020-01-09 03:40:42.000000000 +0100
44
@@ -3,11 +3,6 @@
55
import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
66
import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
@@ -28,7 +28,7 @@ diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.t
2828
StackHeaderTitleProps,
2929
StackCardInterpolatedStyle,
3030
diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx src/vendor/navigators/createStackNavigator.tsx
31-
--- node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-01-07 15:54:09.000000000 +0100
31+
--- node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-01-09 03:40:24.000000000 +0100
3232
+++ src/vendor/navigators/createStackNavigator.tsx 1970-01-01 01:00:00.000000000 +0100
3333
@@ -1,77 +0,0 @@
3434
-import * as React from 'react';
@@ -109,8 +109,8 @@ diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNaviga
109109
- typeof StackNavigator
110110
->(StackNavigator);
111111
diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.tsx
112-
--- node_modules/@react-navigation/stack/src/types.tsx 2020-01-07 15:54:09.000000000 +0100
113-
+++ src/vendor/types.tsx 2020-01-07 16:06:06.000000000 +0100
112+
--- node_modules/@react-navigation/stack/src/types.tsx 2020-01-09 03:40:24.000000000 +0100
113+
+++ src/vendor/types.tsx 2020-01-09 03:40:42.000000000 +0100
114114
@@ -8,13 +8,28 @@
115115
} from 'react-native';
116116
import { EdgeInsets } from 'react-native-safe-area-context';
@@ -255,8 +255,8 @@ diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.t
255255

256256
export type StackNavigationConfig = {
257257
diff -Naur node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/vendor/views/Header/Header.tsx
258-
--- node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-01-07 15:54:09.000000000 +0100
259-
+++ src/vendor/views/Header/Header.tsx 2020-01-07 16:06:09.000000000 +0100
258+
--- node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-01-09 03:40:24.000000000 +0100
259+
+++ src/vendor/views/Header/Header.tsx 2020-01-09 03:40:42.000000000 +0100
260260
@@ -1,11 +1,13 @@
261261
import * as React from 'react';
262262
-import { StackActions } from '@react-navigation/routers';
@@ -325,8 +325,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/
325325
+
326326
+export default Header;
327327
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx src/vendor/views/Header/HeaderBackButton.tsx
328-
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-01-07 15:54:09.000000000 +0100
329-
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-01-07 16:06:06.000000000 +0100
328+
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-01-09 03:40:24.000000000 +0100
329+
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-01-09 03:40:42.000000000 +0100
330330
@@ -8,9 +8,9 @@
331331
StyleSheet,
332332
LayoutChangeEvent,
@@ -339,8 +339,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackButto
339339

340340
type Props = StackHeaderLeftButtonProps;
341341
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx src/vendor/views/Header/HeaderBackground.tsx
342-
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-01-07 15:54:09.000000000 +0100
343-
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-01-07 16:06:06.000000000 +0100
342+
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-01-09 03:40:24.000000000 +0100
343+
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-01-09 03:40:42.000000000 +0100
344344
@@ -1,6 +1,6 @@
345345
import * as React from 'react';
346346
import { Animated, StyleSheet, Platform, ViewProps } from 'react-native';
@@ -350,9 +350,9 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackgroun
350350
export default function HeaderBackground({ style, ...rest }: ViewProps) {
351351
const { colors } = useTheme();
352352
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx src/vendor/views/Header/HeaderContainer.tsx
353-
--- node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-01-07 15:54:09.000000000 +0100
354-
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-01-07 16:06:06.000000000 +0100
355-
@@ -1,16 +1,13 @@
353+
--- node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-01-09 03:40:24.000000000 +0100
354+
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-01-09 03:42:01.000000000 +0100
355+
@@ -1,11 +1,7 @@
356356
import * as React from 'react';
357357
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
358358
-import {
@@ -366,26 +366,28 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer
366366
import { EdgeInsets } from 'react-native-safe-area-context';
367367

368368
import Header from './Header';
369-
import { forStatic } from '../../TransitionConfigs/HeaderStyleInterpolators';
369+
@@ -14,6 +10,7 @@
370+
forNoAnimation,
371+
} from '../../TransitionConfigs/HeaderStyleInterpolators';
370372
import {
371373
+ Route,
372374
Layout,
373375
Scene,
374376
StackHeaderStyleInterpolator,
375-
@@ -93,9 +90,7 @@
377+
@@ -94,9 +91,7 @@
376378
insets,
377379
scene,
378380
previous,
379381
- navigation: scene.descriptor.navigation as StackNavigationProp<
380382
- ParamListBase
381383
- >,
382-
+ navigation: scene.descriptor.navigation as StackNavigationProp,
383-
styleInterpolator: isHeaderStatic ? forStatic : styleInterpolator,
384-
};
385-
384+
+ navigation: scene.descriptor.navigation as StackNavigationProp,
385+
styleInterpolator:
386+
mode === 'float'
387+
? isHeaderStatic
386388
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx src/vendor/views/Header/HeaderSegment.tsx
387-
--- node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-01-07 15:54:09.000000000 +0100
388-
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-01-07 16:06:06.000000000 +0100
389+
--- node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-01-09 03:40:24.000000000 +0100
390+
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-01-09 03:40:42.000000000 +0100
389391
@@ -8,7 +8,7 @@
390392
ViewStyle,
391393
} from 'react-native';
@@ -405,8 +407,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.t
405407
};
406408

407409
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx src/vendor/views/Header/HeaderTitle.tsx
408-
--- node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-01-07 15:54:09.000000000 +0100
409-
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-01-07 16:06:06.000000000 +0100
410+
--- node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-01-09 03:40:24.000000000 +0100
411+
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-01-09 03:40:42.000000000 +0100
410412
@@ -1,6 +1,6 @@
411413
import * as React from 'react';
412414
import { Animated, StyleSheet, Platform, TextProps } from 'react-native';
@@ -416,8 +418,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx
416418
type Props = TextProps & {
417419
tintColor?: string;
418420
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/Card.tsx src/vendor/views/Stack/Card.tsx
419-
--- node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-01-07 15:54:09.000000000 +0100
420-
+++ src/vendor/views/Stack/Card.tsx 2020-01-07 16:06:06.000000000 +0100
421+
--- node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-01-09 03:40:24.000000000 +0100
422+
+++ src/vendor/views/Stack/Card.tsx 2020-01-09 03:40:42.000000000 +0100
421423
@@ -483,7 +483,7 @@
422424
pointerEvents="none"
423425
/>
@@ -428,8 +430,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/Card.tsx src/ven
428430
<CardAnimationContext.Provider value={animationContext}>
429431
{children}
430432
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx src/vendor/views/Stack/CardContainer.tsx
431-
--- node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-01-07 15:54:09.000000000 +0100
432-
+++ src/vendor/views/Stack/CardContainer.tsx 2020-01-07 16:06:06.000000000 +0100
433+
--- node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-01-09 03:40:24.000000000 +0100
434+
+++ src/vendor/views/Stack/CardContainer.tsx 2020-01-09 03:40:42.000000000 +0100
433435
@@ -1,11 +1,17 @@
434436
import * as React from 'react';
435437
import { Animated, View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
@@ -461,8 +463,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardContainer.ts
461463
>
462464
<View style={styles.container}>
463465
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx src/vendor/views/Stack/CardStack.tsx
464-
--- node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-01-07 15:54:09.000000000 +0100
465-
+++ src/vendor/views/Stack/CardStack.tsx 2020-01-07 16:06:06.000000000 +0100
466+
--- node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-01-09 03:40:24.000000000 +0100
467+
+++ src/vendor/views/Stack/CardStack.tsx 2020-01-09 03:40:42.000000000 +0100
466468
@@ -11,8 +11,7 @@
467469
import { EdgeInsets } from 'react-native-safe-area-context';
468470
// eslint-disable-next-line import/no-unresolved
@@ -482,8 +484,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx sr
482484
StackHeaderMode,
483485
StackCardMode,
484486
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx src/vendor/views/Stack/StackView.tsx
485-
--- node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-01-07 15:54:09.000000000 +0100
486-
+++ src/vendor/views/Stack/StackView.tsx 2020-01-07 16:06:06.000000000 +0100
487+
--- node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-01-09 03:40:24.000000000 +0100
488+
+++ src/vendor/views/Stack/StackView.tsx 2020-01-09 03:44:43.000000000 +0100
487489
@@ -1,8 +1,11 @@
488490
import * as React from 'react';
489491
import { Platform } from 'react-native';
@@ -547,32 +549,27 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx sr
547549
this.setState(state => ({
548550
routes: state.replacingRouteKeys.length
549551
? state.routes.filter(r => !state.replacingRouteKeys.includes(r.key))
550-
@@ -283,15 +305,19 @@
552+
@@ -282,10 +304,15 @@
553+
// If a route exists in state, trigger a pop
551554
// This will happen in when the route was closed from the card component
552555
// e.g. When the close animation triggered from a gesture ends
553-
// For the cleanup, the card needs to call this function again from its componentDidUpdate
554556
- navigation.dispatch({
555557
- ...StackActions.pop(),
556558
- source: route.key,
557559
- target: state.key,
558-
- });
559560
+ // @ts-ignore
560561
+ navigation.dispatch(StackActions.pop({ key: route.key }));
561-
} else {
562-
// Otherwise, the animation was triggered due to a route removal
563-
// In this case, we need to clean up any state tracking the route and pop it immediately
564-
562+
+ } else {
565563
+ // While closing route we need to point to the previous one assuming that
566564
+ // this previous one in routes array
567565
+ const index = this.state.routes.findIndex(r => r.key === route.key);
566+
+
568567
+ this.handleTransitionComplete({
569568
+ route: this.state.routes[Math.max(index - 1, 0)],
570-
+ });
571-
+
572-
// @ts-ignore
573-
this.setState(state => ({
574-
routes: state.routes.filter(r => r.key !== route.key),
575-
@@ -308,22 +334,26 @@
569+
});
570+
}
571+
572+
@@ -300,22 +327,26 @@
576573
private handleTransitionStart = (
577574
{ route }: { route: Route<string> },
578575
closing: boolean

yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,10 +1369,10 @@
13691369
query-string "^6.4.2"
13701370
react-is "^16.8.6"
13711371

1372-
"@react-navigation/core@^5.0.0-alpha.30":
1373-
version "5.0.0-alpha.30"
1374-
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-5.0.0-alpha.30.tgz#cde10907b051148e714f6eb92811a9151791e0c7"
1375-
integrity sha512-3FnTvyYqNl7uobdyvJhQ15JXhVcT4oKzJqS9em7miXUZQe0s+xIFhUhmNbptNrbOgCc8Ya3B2UMK+gsbe4OX+g==
1372+
"@react-navigation/core@^5.0.0-alpha.32":
1373+
version "5.0.0-alpha.32"
1374+
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-5.0.0-alpha.32.tgz#b7c4f68e405080062df95936998be8e44ceb3e2a"
1375+
integrity sha512-HCPNXPoTzE8IOsexrjqr14F/w1B5C9ZoTdeokKphK7oxvMrt8ceDkb1AR7KmNT2zEXbzt3FZ9LW0V+Y9sGY2LA==
13761376
dependencies:
13771377
escape-string-regexp "^2.0.0"
13781378
query-string "^6.9.0"
@@ -1388,20 +1388,20 @@
13881388
react-native-safe-area-view "^0.14.1"
13891389
react-native-screens "^1.0.0 || ^1.0.0-alpha"
13901390

1391-
"@react-navigation/routers@^5.0.0-alpha.20":
1392-
version "5.0.0-alpha.20"
1393-
resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-5.0.0-alpha.20.tgz#f0c89baf2331f01ff90391f3e9a00a9d048a45be"
1394-
integrity sha512-Kxft5TEcA5JWGxw5KyvY/AAC14+yOS7gdtlVm9EhEkZYbJRMudFwj8MnG4XtOll9uhEwJdFLV4e1wbTTJP2Hlw==
1391+
"@react-navigation/routers@^5.0.0-alpha.22":
1392+
version "5.0.0-alpha.22"
1393+
resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-5.0.0-alpha.22.tgz#db2086012ad9660da95df7b34fcb23b89f4a7429"
1394+
integrity sha512-GaTDJk7PeSbdStUfODb4VSDkwPUNtuZRYToTqwbI7WvY1yuRJbYZS2Jkrk/waOdf13U0rt7xDcdpmfGUNuZ2DQ==
13951395
dependencies:
1396-
"@react-navigation/core" "^5.0.0-alpha.30"
1396+
"@react-navigation/core" "^5.0.0-alpha.32"
13971397
shortid "^2.2.15"
13981398

1399-
"@react-navigation/stack@^5.0.0-alpha.56":
1400-
version "5.0.0-alpha.56"
1401-
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.0.0-alpha.56.tgz#1ea44e6511b52df004659ae8f849a123e9a2fecf"
1402-
integrity sha512-Cq21URqCmqPo2UKKR1hJ5PrxdCD9njmcwrACorMouOVx7irkE0Kl52ffQJhemG2PfadJrLfVHIKhca9n30BfHg==
1399+
"@react-navigation/stack@^5.0.0-alpha.58":
1400+
version "5.0.0-alpha.58"
1401+
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.0.0-alpha.58.tgz#4c2dbd2356ea7c5cc6a934a79ef9c353bdac9b55"
1402+
integrity sha512-oHwG5D6dZLoB7jZBxlKuIzXaNcFTwnyL948UNbQaNBBLj1umW3B9Wn3ekoRUhBY40P/wcCQkGnUARTzH1c1dhw==
14031403
dependencies:
1404-
"@react-navigation/routers" "^5.0.0-alpha.20"
1404+
"@react-navigation/routers" "^5.0.0-alpha.22"
14051405
color "^3.1.2"
14061406
react-native-iphone-x-helper "^1.2.1"
14071407

0 commit comments

Comments
 (0)