Last active
March 30, 2020 12:41
-
-
Save mattgperry/1d2679bd926ef65bc94f44b08a626cad 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 Component = () => { | |
const frameCount = useRef(0) | |
const prevValues = useRef() | |
return <motion.div transformValues={values => { | |
frameCount.current++ | |
const valuesToReturn = isEven(frameCount.current) ? prevValues.current : values | |
prevValues.current = values | |
return valuesToReturn | |
}} /> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment