refactor: simplify props for stack and drawer headers

BREAKING CHANGE: Previously, the stack header accepted scene and previous scene which contained things such as descriptor, navigation prop, progress etc. The commit simplifies them to pass `route`, `navigation`, `options` and `progress` directly to the header. Similaryly, the `previous` argument now contains `options`, `route` and `progress`.
This commit is contained in:
Satyajit Sahoo
2020-11-12 02:47:51 +01:00
parent d5c091cbcf
commit 4cad132c2c
11 changed files with 129 additions and 101 deletions

View File

@@ -91,7 +91,7 @@ type Props = Partial<React.ComponentProps<typeof SimpleStack.Navigator>> &
StackScreenProps<ParamListBase>;
function CustomHeader(props: StackHeaderProps) {
const { current, next } = props.scene.progress;
const { current, next } = props.progress;
const progress = Animated.add(current, next || 0);
const opacity = progress.interpolate({