Skip to content

Instantly share code, notes, and snippets.

@stephencookdev
Created July 16, 2018 15:18
Show Gist options
  • Save stephencookdev/67493ec7ea71349004eaeb50f927e75d to your computer and use it in GitHub Desktop.
Save stephencookdev/67493ec7ea71349004eaeb50f927e75d to your computer and use it in GitHub Desktop.
`SwitchWithSlide` example - hoc
const animateSwitch = (CustomSwitch, AnimatorComponent) => ({
children,
}) => (
<Route
render={({ location }) => (
<AnimatorComponent uniqKey={location.pathname}>
<CustomSwitch location={location}>{children}</CustomSwitch>
</AnimatorComponent>
)}
/>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment