title: Getting an error with react-router-dom, that I can't solve
body: <p>I have the following code </p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom'
  import { BrowserRouter as Router, Route, Switch, Link } from 'react-router-dom'
  import 'normalize.css/normalize.css'
  import './styles/styles.scss'
  
  const ExpenseDashboardPage = () =&gt; (
      &lt;div&gt;
          This is from my dashboard component
      &lt;/div&gt;
  )
  
  const AddExpensePage = () =&gt; (
      &lt;div&gt;
          This is from my add expense component
      &lt;/div&gt;
  )
  
  const EditExpensePage = () =&gt; (
      &lt;div&gt;
          This is for editing expenses component
      &lt;/div&gt;
  )
  
  const HelpPage = () =&gt; (
      &lt;div&gt;
          This is help component
      &lt;/div&gt;
  )
  
  const NotFoundPage = () =&gt; (
      &lt;div&gt;
          404! &lt;Link to='/'&gt;Go Home&lt;/Link&gt;
      &lt;/div&gt;
  )
  
  const Header = () =&gt; (
      &lt;header&gt;
          &lt;h1&gt;Expensify&lt;/h1&gt;
          &lt;Link to="/"&gt;Home&lt;/Link&gt;
          &lt;Link to='/create'&gt;Add Expense&lt;/Link&gt;
          &lt;Link to='/edit'&gt;Edit Expense&lt;/Link&gt;
          &lt;Link to='/help'&gt;Help&lt;/Link&gt;
      &lt;/header&gt;
  )
  
  const routes = (
      &lt;div&gt;
          &lt;Header /&gt;
          &lt;Router&gt;
              &lt;Switch&gt;
                  &lt;Route exact path='/' component={ExpenseDashboardPage} /&gt;
                  &lt;Route path='/create' component={AddExpensePage} /&gt;
                  &lt;Route path='/edit' component={EditExpensePage} /&gt;
                  &lt;Route path='/help' component={HelpPage} /&gt;
                  &lt;Route component={NotFoundPage} /&gt;
              &lt;/Switch&gt;
          &lt;/Router&gt;
      &lt;/div&gt;
  )
  
  
  ReactDOM.render(routes, document.getElementById('app'))
  </code></pre>
  
  <p>I am following a tutorial, however their header component works as is above; however, I am getting an error in the console with nothing rendering on the page. </p>
  
  <p><code>VM84 bundle.js:40892 Uncaught Error: Invariant failed: You should not use &lt;Link&gt; outside a &lt;Router&gt;</code>  </p>
  
  <p>I believe I have to do something with <code>withRouter</code>, but am not sure how to proceed.</p>
  
  <p>I have a link to the github repo where the code is as well, as I am using webpack and babel to bundle my project. <a href="https://github.com/altafmquadri/expensify-app" rel="nofollow noreferrer">https://github.com/altafmquadri/expensify-app</a>.  </p>