import React from 'react'; import { NavLink, Switch, Route, withRouter, RouteComponentProps } from 'react-router-dom'; import TabNav from '../TabNav'; class ExampleBase extends React.Component { render () { return (
NavLink A NavLink B
Content A
} />
Content B
} />
); } } // in our exporting of the component, we wrap it in withRouter(), giving it access to the props that we need for the Routes const TabNavReactRouterExample = withRouter(ExampleBase); export default TabNavReactRouterExample;