Skip to content

Instantly share code, notes, and snippets.

@ashrithks
Created March 20, 2018 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashrithks/50db632338ba811104dec79635634b98 to your computer and use it in GitHub Desktop.
Save ashrithks/50db632338ba811104dec79635634b98 to your computer and use it in GitHub Desktop.
let SlideFromRight = (index, position, width) => {
const inputRange = [index - 1, index, index + 1];
const translateX = position.interpolate({
inputRange: [index - 1, index, index + 1],
outputRange: [width, 0, 0]
})
const slideFromRight = { transform: [{ translateX }] }
return slideFromRight
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment