Too Long; Didn't Read
Last week, I outlined a <a href="https://hackernoon.com/simple-guide-to-creating-a-single-page-app-with-react-router-6b6f709a2e3f" target="_blank">basic setup for React Router to set up a single page application</a>. I used a portfolio site as an example, and there wasn’t much complexity to the components being used. However, you’ll often have the need for deeply nested components, so React Router includes the withRouter method to give you access to the match, location, and history properties of the browser’s native API necessary to make your Link and Route components work correctly. It’s fairly easy to use, but there are a few issues to watch out for when using it. Here’s a contrived, basic example: