Created
March 20, 2018 11:03
-
-
Save ashrithks/3b5073bfc905a4c934380954c8643652 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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