title: React(v4) - exporting component with withRouter returns error
body: <p>This problem might be a bug according to another post here <a href="https://stackoverflow.com/questions/43175941/react-router-v4-cannot-read-property-route-of-undefined">React-Router v4: Cannot read property &#39;route&#39; of undefined</a> and apparently the person solved their problem by wrapping their routers in a browserRouter.  However, I have done that already and still seem to be getting the error.  Just like the other post, when I export my component with withRouter, it returns an error, however when I export it without it, it works fine.  What I am trying to do is, find the pathname when a person loads a Route, check to see if they are authenitcated, if not, redirect to login, if they are, redirect to home.   I've had this problem for a while now, if you know a solution please help me.  </p>
  
  <p><strong>Routes.js</strong></p>
  
  <pre><code>import { Meteor } from "meteor/meteor"
  import React from "react";
  import { withRouter, Switch, BrowserRouter, Route, Redirect, Link } from "react-router-dom";
  import { Tracker } from "meteor/tracker";
  
  import Login from "../ui/authentication/Login";
  import Signup from "../ui/authentication/Signup";
  import Home from "../ui/Home";
  import searchNotes from "../ui/searchNotes"
  import Note from "../ui/Note";
  import fullSize from "../ui/fullSize"
  import userProfile from "../ui/userProfile";
  import AddNote from "../ui/AddNote";
  import questions from "../ui/questions"
  import NotFound from "../ui/NotFound";
  
    export default class Routes extends React.Component{
    render(){
      const signedIn = Meteor.userId();
      const UnauthPage = ["/login", "/signup"];
      console.log(this.props)
      // if(signedIn &amp;&amp; ){
      //   console.log("Signed in")
      // }
      return (
          &lt;BrowserRouter&gt;
            &lt;Switch&gt;
              &lt;Login path="/login" /&gt;
              &lt;Signup path="/signup" /&gt;
              &lt;Route path="/" component={Home} exact/&gt;
              &lt;Route path={`/searchNotes/:subject`} component={Note} /&gt;
              &lt;Route path={`/searchNotes`} component={searchNotes} /&gt;
              &lt;Route path={`/fullSize/:noteId`} component={fullSize}/&gt;
              &lt;AddNote path="/addNote"/&gt;
              &lt;Route path="/questions" component={questions} /&gt;
              &lt;Route component={userProfile} path={`/users/:userId`} /&gt;
              &lt;NotFound /&gt;
            &lt;/Switch&gt;
          &lt;/BrowserRouter&gt;
      )
    }
  }
  </code></pre>