Skip to content

Instantly share code, notes, and snippets.

@sonicoder86
Created April 15, 2020 18:25
Show Gist options
  • Save sonicoder86/0883271c2f10c6f28939a06204ab9ec5 to your computer and use it in GitHub Desktop.
Save sonicoder86/0883271c2f10c6f28939a06204ab9ec5 to your computer and use it in GitHub Desktop.
React Testing Crash Course - part 12
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