title: React component is not removed when changing path
body: <p>I have my application created in create-react-app.
  when I go to the path / &quot;users / create&quot; the page remains the component of the path users (&quot;users&quot;) on the screen and the component is not deleted
  When reloading the path page (&quot;users / create&quot;) it works for me perfectly</p>
  <p>I send screenshots of the code</p>
  <p>-Routes</p>
  <pre><code>function App() {
    return (
      &lt;LoginState&gt;
        &lt;AlertState&gt;
          &lt;DashboardState&gt;
            &lt;DocumentState&gt;
              &lt;UsersState&gt;
                &lt;RelasesState&gt;
                  &lt;Router&gt;
                    &lt;Switch&gt;
                      &lt;Route exact path=&quot;/login&quot; component={Login}/&gt;
                      &lt;Route exact path=&quot;/reset-pwd&quot; component={ResetPwd}/&gt;
                      &lt;div className=&quot;wrapper&quot;&gt;
                        &lt;Header /&gt;
                        &lt;div className=&quot;main-panel&quot;&gt;
                          &lt;RoutePrivate exact path=&quot;/&quot; component={Dashboard}/&gt;
                          &lt;RoutePrivate exact path=&quot;/documents&quot; component={Documents}/&gt;
                          &lt;RoutePrivate exact path=&quot;/document/:id&quot; component={Document}/&gt;
                          &lt;RoutePrivate exact path=&quot;/usuarios&quot; component={Users}/&gt;
                          &lt;RoutePrivate exact path=&quot;/usuarios/:userId&quot; component={Users}/&gt;
                          &lt;RoutePrivate exact path=&quot;/usuarios/create&quot; component={NewUser}/&gt;
                          &lt;RoutePrivate exact path=&quot;/usuarios/show/:id&quot; component={User}/&gt;
                          &lt;RoutePrivate exact path=&quot;/usuarios/edit/:id&quot; component={EditUser}/&gt;
                          &lt;RoutePrivate exact path=&quot;/comunicados&quot; component={Relases}/&gt;
                          &lt;RoutePrivate exact path=&quot;/comunicados/:id&quot; component={Relases}/&gt;
                          &lt;RoutePrivate exact path=&quot;/comunicados/send-email/:id&quot; component={Relase}/&gt;
                          &lt;RoutePrivate exact path=&quot;/docslab&quot; component={DocsLab} /&gt;
                        &lt;/div&gt;
                        &lt;Sidebar /&gt;
                      &lt;/div&gt;
                    &lt;/Switch&gt;
                  &lt;/Router&gt;
                &lt;/RelasesState&gt;
              &lt;/UsersState&gt;
            &lt;/DocumentState&gt;
          &lt;/DashboardState&gt;
        &lt;/AlertState&gt;
      &lt;/LoginState&gt;
    );
  }
  
  export default App;
  </code></pre>
  <p>&quot;/usuarios&quot;
  <a href="https://i.stack.imgur.com/s3Ux9.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>When changing from the page itself with a link to &quot;create/users&quot; it returns the previous component and below the new one
  <a href="https://i.stack.imgur.com/Ph8Vn.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I have noticed that when I remove the dynamic path from &quot;/usuarios/:userId&quot; everything works fine for me, what do you think I have done wrong?
  Thank you very much for your support.</p>