title: Single page application with Laravel-react
body: <p>I am developing laravel-react js project for the first time. The reason for choosing react is to create single page application (SPA).</p>
  <p>To setup my laravel project with react I am following this article</p>
  <p><a href="https://medium.com/@000kelvin/setting-up-laravel-and-react-js-the-right-way-using-user-authentication-1cfadf3194e" rel="nofollow noreferrer">https://medium.com/@000kelvin/setting-up-laravel-and-react-js-the-right-way-using-user-authentication-1cfadf3194e</a></p>
  <p>To create SPA, I am returning the same view for every fisrt level url by writing this line in my web.php</p>
  <pre><code>Route::view('/{path?}', 'index');
  </code></pre>
  <p>I have also created some route in my react component as follows</p>
  <pre><code>&lt;Switch&gt;
      &lt;Route exact path=&quot;/&quot; component={Home}/&gt;
      &lt;Route path=&quot;/login&quot; component={Login}/&gt;
      &lt;Route path=&quot;/signup&quot; component={Signup}/&gt;
  &lt;/Switch&gt;
  </code></pre>
  <p>Now the problem is when change the url it will refresh the same view with different component.</p>
  <p>I just wanted to render different component with respect to url without refreshing the whole page, otherwise what's the point of SPA.</p>
  <p>can anybody show me the correct way of meeting my requirement or it is like this with Laravel and react.</p>