title: React router redirect outside of route component
body: <p>I use React Router in my React application.
  In Header component that isn't inside Router component i want to redirect user after register a form, but because Header component is outside of Router component i can't use <code>this.props.history.push('/');</code>.
  How can i redirect user in Header component?
  This is my App component:</p>
  
  <pre><code>&lt;div&gt;
      &lt;Header order={this.order}/&gt;
      &lt;Router data={this.state.data}&gt;
        &lt;div&gt;
          &lt;Menu data={this.state.data}/&gt;
          &lt;Route exact path="/" component={Home} /&gt;
          &lt;Route exact path="/post" component={PostList} /&gt;
          &lt;Route path="/showpost/:slug" component={ShowPost} /&gt;
          &lt;Route path="/page/:slug" component={ShowPage} /&gt;
          &lt;Route path="/login" component={Login} /&gt;
          &lt;Route path="/register" component={Register} /&gt;
          &lt;Route path="/forgotpassword" component={Forgot} /&gt;
          &lt;Route path="/password/reset/:token" component={Reset} /&gt;
          &lt;Route path="/logout" component={Logout} /&gt;
          &lt;Route path="/user" component={User} /&gt;
          &lt;Route path="/saveorder" render={()=&gt;&lt;SaveOrder data={this.state.data}/&gt;} /&gt;
        &lt;/div&gt;
      &lt;/Router&gt;
      &lt;Map /&gt;
      &lt;Footer /&gt;
    &lt;/div&gt;
  </code></pre>