chore: reuse the stack code from react navigation 5

The code for the stack is almost the same as v5, with the only differences being the types and the navigation object. To avoid making same changes in 2 places which error-prone, I decided to reuse the same code. Due to the differences, it's not possible to just use it as a dependency, so I followed this approach:
- Copy the source files on post install and apply patches to make it work with React Navigation 4
- When we need to make changes, we can make them in v5 repo and update the version here, most of the time it wouldn't need any extra work
- If we need to make v4 specific changes, we can change the code in vendor/ and then re-generate the patch with `yarn patch`
This commit is contained in:
Satyajit Sahoo
2019-12-10 15:22:12 +01:00
parent 5a38b0f05b
commit 8b11e4df0c
60 changed files with 4090 additions and 6731 deletions

View File

@@ -11,7 +11,7 @@ import {
createStackNavigator,
CardStyleInterpolators,
NavigationStackScreenProps,
CardStyleInterpolator,
StackCardStyleInterpolator,
} from 'react-navigation-stack';
import Animated from 'react-native-reanimated';
@@ -21,7 +21,7 @@ const gestureResponseDistance = {
vertical: Dimensions.get('window').height,
};
const forVerticalInvertedIOS: CardStyleInterpolator = ({
const forVerticalInvertedIOS: StackCardStyleInterpolator = ({
current: { progress },
layouts: { screen },
}) => {