title: How to integrate React app into Wordpress (react router)?
body: <p>I've created a react app to embed to wordpress site.
  React app is created by create-react-app and after bundling, I've uploaded it to wordpress site.
  Then created a page to load the bundled js file. (following this guide <a href="https://medium.com/@CodeCareerCoach/react-app-inside-a-wordpress-page-or-post-4c7d38181b3d" rel="nofollow noreferrer">https://medium.com/@CodeCareerCoach/react-app-inside-a-wordpress-page-or-post-4c7d38181b3d</a>)</p>
  
  <p>So it shows the react app and works for the base route. <br></p>
  
  <p>When I navigate, it still works, when I refresh I get 404 ERR.</p>
  
  <p>This is the routing of react app.</p>
  
  <pre><code>  return &lt;BrowserRouter basename='/testweb'&gt;
      &lt;Layout menuItems={menuItems} pages={pages}&gt;
        &lt;Switch&gt;
            &lt;Route exact path="/" render={() =&gt; &lt;div&gt;okay&lt;/div&gt;} /&gt;
            &lt;Route exact path="/home" render={(props) =&gt; {
                return &lt;div&gt;asdf&lt;/div&gt;
              }} 
            /&gt;
  ...
            &lt;Route render={(props)=&gt; props.location.pathname } /&gt;
        &lt;/Switch&gt;
      &lt;/Layout&gt;
    &lt;/BrowserRouter&gt;
  </code></pre>
  
  <p>in package.json, I've set <code>homepage</code> to <code>/testweb</code>
  How can I get the nested routes working?</p>