Skip to content

Instantly share code, notes, and snippets.

@ashrithks
Created March 20, 2018 11:03
Show Gist options
  • Save ashrithks/3b5073bfc905a4c934380954c8643652 to your computer and use it in GitHub Desktop.
Save ashrithks/3b5073bfc905a4c934380954c8643652 to your computer and use it in GitHub Desktop.
const TransitionConfiguration = () => {
return {
transitionSpec: {
duration: 750,
easing: Easing.out(Easing.poly(4)),
timing: Animated.timing,
useNativeDriver: true,
},
screenInterpolator: (sceneProps) => {
const { layout, position, scene } = sceneProps;
const width = layout.initWidth;
const { index, route } = scene
const params = route.params || {}; // <- That's new
const transition = params.transition || 'default'; // <- That's new
return {
collapseExpand: CollapseExpand(index, position),
default: SlideFromRight(index, position, width),
}[transition];
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment