Created
April 15, 2020 18:25
-
-
Save sonicoder86/0883271c2f10c6f28939a06204ab9ec5 to your computer and use it in GitHub Desktop.
React Testing Crash Course - part 12
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 React from 'react'; | |
import { withRouter } from 'react-router'; | |
import { Route, Switch } from 'react-router-dom'; | |
const Footer = withRouter(({ location }) => ( | |
<div data-testid="location-display">{location.pathname}</div> | |
)); | |
const App = () => { | |
return ( | |
<div> | |
<Switch> | |
<Route component={Footer} /> | |
</Switch> | |
</div> | |
) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment