Created
March 27, 2018 18:35
-
-
Save jasonrhodes/b551380bc2c17c2c61683894b6adb751 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
import { Route } from 'react-router-dom' | |
export default function Redirect({ to, from, ...rest }) { | |
return <Route path={from} {...rest} render={({ location }) => ( | |
<Redirect to={{ ...location, pathname: to }} /> | |
)} /> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment