Created
September 25, 2018 12:01
-
-
Save m-allanson/fdec624abacf1a5f3cd819ed87622d38 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
static getDerivedStateFromProps(props, state) { | |
const { pathname } = props.location; | |
if (!state.lastPathname || pathname !== state.lastPathname) { | |
return { | |
lastPathname: pathname, | |
transitionName: getTransitionName({ | |
from: state.lastPathname, | |
to: pathname, | |
}); | |
}; | |
} | |
return null; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment