Last active
April 30, 2019 19:39
-
-
Save the-teacher/62b3a45f0b4974cd9a965665f033c31d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 React from 'react' | |
import { Router, Route } from 'react-router-dom' | |
import { createMemoryHistory } from 'history' | |
const history = createMemoryHistory() | |
const TestingRouter = ({ ComponentWithRedirection, RedirectUrl }) => ( | |
<Router history={history}> | |
<Route path="/" exact={true} render={() => <ComponentWithRedirection />} /> | |
<Route path={RedirectUrl} render={() => <div>{RedirectUrl}</div>} /> | |
</Router> | |
) | |
export default TestingRouter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment