import withrouter code example Example: import withrouter import { withRouter } from 'react-router-dom';