@@ -14,18 +14,18 @@ To use this navigator, you need to install [`@react-navigation/stack`](https://g
14
14
yarn add @react-navigation/native@next @react-navigation/stack@next @react-native-community/masked-view
15
15
```
16
16
17
- Now we need to install [ ` react-native-gesture-handler ` ] ( https://github.com/kmagiera/react-native-gesture-handler ) , [ ` react-native-reanimated ` ] ( https://github.com/kmagiera/react-native-reanimated ) , [ ` react-native- screens` ] ( https://github.com/kmagiera/react-native-screens ) and [ ` react-native-safe-area-context ` ] ( https://github.com/th3rdwave/react-native-safe-area-context ) .
17
+ Now we need to install [ ` react-native-gesture-handler ` ] ( https://github.com/kmagiera/react-native-gesture-handler ) , [ ` react-native-screens ` ] ( https://github.com/kmagiera/react-native-screens ) and [ ` react-native-safe-area-context ` ] ( https://github.com/th3rdwave/react-native-safe-area-context ) .
18
18
19
19
If you are using Expo, to ensure that you get the compatible versions of the libraries, run:
20
20
21
21
``` sh
22
- expo install react-native-gesture-handler react-native-reanimated react-native- screens react-native-safe-area-context
22
+ expo install react-native-gesture-handler react-native-screens react-native-safe-area-context
23
23
```
24
24
25
25
If you are not using Expo, run the following:
26
26
27
27
``` sh
28
- yarn add react-native-reanimated react-native- gesture-handler react-native-screens react-native-safe-area-context
28
+ yarn add react-native-gesture-handler react-native-screens react-native-safe-area-context
29
29
```
30
30
31
31
If you are using Expo, you are done. Otherwise, continue to the next steps.
@@ -77,7 +77,7 @@ public class MainActivity extends ReactActivity {
77
77
Then add the following at the top of your entry file, such as ` index.js ` or ` App.js ` :
78
78
79
79
``` js
80
- import ' react-native-gesture-handler'
80
+ import ' react-native-gesture-handler' ;
81
81
```
82
82
83
83
Finally, run ` react-native run-android ` or ` react-native run-ios ` to launch the app on your device/simulator.
@@ -468,9 +468,9 @@ Stack Navigator exposes various options to configure the transition animation wh
468
468
The function receives the following properties in it's argument:
469
469
470
470
- ` current ` - Values for the current screen:
471
- - ` progress ` - Renimated node representing the progress value of the current screen.
471
+ - ` progress ` - Animated node representing the progress value of the current screen.
472
472
- ` next ` - Values for the current screen the screen after this one in the stack. This can be ` undefined ` in case the screen animating is the last one.
473
- - ` progress ` - Renimated node representing the progress value of the next screen.
473
+ - ` progress ` - Animated node representing the progress value of the next screen.
474
474
- ` index ` - The index of the card in the stack.
475
475
- ` closing ` - Animated node representing whether the card is closing. ` 1 ` when closing, ` 0 ` if not.
476
476
- ` layouts ` - Layout measurements for various items we use for animation.
@@ -481,14 +481,7 @@ Stack Navigator exposes various options to configure the transition animation wh
481
481
``` js
482
482
const forFade = ({ current, closing }) => ({
483
483
cardStyle: {
484
- opacity: cond (
485
- closing,
486
- current .progress ,
487
- interpolate (current .progress , {
488
- inputRange: [0 , 0.5 , 0.9 , 1 ],
489
- outputRange: [0 , 0.25 , 0.7 , 1 ],
490
- })
491
- ),
484
+ opacity: current .progress ,
492
485
},
493
486
});
494
487
```
@@ -513,9 +506,9 @@ Stack Navigator exposes various options to configure the transition animation wh
513
506
The function receives the following properties in it's argument:
514
507
515
508
- ` current ` - Values for the current screen (the screen which owns this header).
516
- - ` progress ` - Renimated node representing the progress value of the current screen.
509
+ - ` progress ` - Animated node representing the progress value of the current screen.
517
510
- ` next ` - Values for the current screen the screen after this one in the stack. This can be ` undefined ` in case the screen animating is the last one.
518
- - ` progress ` - Renimated node representing the progress value of the next screen.
511
+ - ` progress ` - Animated node representing the progress value of the next screen.
519
512
- ` layouts ` - Layout measurements for various items we use for animation. Each layout object contain ` height ` and ` width ` properties.
520
513
- ` screen ` - Layout of the whole screen.
521
514
- ` title ` - Layout of the title element. Might be ` undefined ` when not rendering a title.
@@ -525,13 +518,13 @@ Stack Navigator exposes various options to configure the transition animation wh
525
518
526
519
``` js
527
520
const forFade = ({ current, next }) => {
528
- const opacity = interpolate (
529
- add ( current .progress , next ? next . progress : 0 ) ,
530
- {
531
- inputRange : [ 0 , 1 , 2 ],
532
- outputRange : [0 , 1 , 0 ],
533
- }
534
- );
521
+ const opacity = Animated . add (
522
+ current .progress ,
523
+ next ? next . progress : 0
524
+ ). interpolate ({
525
+ inputRange : [0 , 1 , 2 ],
526
+ outputRange : [ 0 , 1 , 0 ],
527
+ } );
535
528
536
529
return {
537
530
leftButtonStyle: { opacity },
0 commit comments