title: You should not use Route or withRouter() outside a Router when using react-router 4 and styled-component in react
body: <p>I'm trying to build my first portfolio website and got stuck in routing using react-router-dom 4.2.2 and styled-components 2.2.3. </p>
  
  <p>error message: <strong>You should not use Route or withRouter() outside a Router</strong></p>
  
  <p>I also try using Link instead of NavLink but got error too(<strong>You should not use Link outside a Router</strong>)</p>
  
  <p>Someone help me please.</p>
  
  <p><strong>navigationBar.js</strong></p>
  
  <pre><code>import React, { Component } from 'react';
  import { NavigationContainer, NavItem } from './navigationBar.style';
  
  class NavigationBar extends Component {
    render() {
      return (
        &lt;NavigationContainer&gt;
          &lt;NavItem to="/"&gt;Home&lt;/NavItem&gt;
          &lt;NavItem to="/projects"&gt;Project&lt;/NavItem&gt;
        &lt;/NavigationContainer&gt;
      );
    }
  }
  
  export default NavigationBar;
  </code></pre>
  
  <p><strong>navigationBar.style.js</strong></p>
  
  <pre><code>import styled from 'styled-components';
  import { Flex, Div } from 'theme/grid';
  import { NavLink } from 'react-router-dom';
  
  export const NavigationContainer = styled(Flex)`
    position: fixed;
    right: 20px;
    top: 0.5em;
    font-size: 1em;  
  `;
  export const NavItem = styled(NavLink)`
    position: relative;
    padding-left: 10px;
    cursor: pointer;
  `;
  </code></pre>