title: Using Strict mode outside Router tag breaks my app
body: <p>React version:</p>
  <pre><code>    &quot;react&quot;: &quot;^18.0.0&quot;,
      &quot;react-dom&quot;: &quot;^18.0.0&quot;,
      &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
  </code></pre>
  <h2>Steps To Reproduce</h2>
  <p>I am trying to add the StrictMode on my code to avoid issues, but when I put it outside the  tag the routes changes as expected but the component does not render. When I moved the StrictMode tag inside the Router tag, the application works as expected.</p>
  <h2>Code example:</h2>
  <p>If I put the <code>StrictMode</code> outside the Router, the components does not render:</p>
  <pre><code>return (
      &lt;StrictMode&gt;
        &lt;Router history={history}&gt;
          &lt;Route exact path=&quot;/&quot;&gt;
                  ....
        &lt;/Router&gt;
      &lt;/StrictMode&gt;
    );
  };
  
  </code></pre>
  <p>If I put it inside the Router, the components renders as expected:</p>
  <pre><code>return (
     &lt;Router history={history}&gt;
       &lt;StrictMode&gt;
          &lt;Route exact path=&quot;/&quot;&gt;
                  ....
       &lt;/StrictMode&gt;
     &lt;/Router&gt;
    );
  };
  </code></pre>
  <h2>The current behavior</h2>
  <p>When the URL changes, the expected component is not being rendered on the UI.</p>
  <p><img src="https://user-images.githubusercontent.com/21174759/165537591-e882e4b2-fa3e-41e7-a043-39276eff46ab.gif" alt="ezgif com-gif-maker" /></p>
  <h2>The expected behavior</h2>
  <p>When the URL changes, the expected component should be rendered on the UI.</p>
  <p>Any idea of why this problem can be happening? Any ideas on how to fix this?</p>