title: React testing library not work with react router v6
body: <p>i start to learning react testing library a few days ago and i dont know how to make my tests works with react router v6. I have this two test below:</p>
  <pre><code>  describe('testing login page', () =&gt; {
    test('veryfy inputs and buttons in login page', () =&gt; {
      render(
        &lt;MemoryRouter initialEntries={['/']}&gt;
          &lt;Routes&gt;
            &lt;Route path=&quot;/&quot; element={&lt;LoginPage /&gt;} /&gt;
          &lt;/Routes&gt;
        &lt;/MemoryRouter&gt;,
      );
      const userInput = screen.getByRole('textbox');
      expect(userInput).toBeInTheDocument();
  </code></pre>
  <pre><code>  describe('testing Mine Page', () =&gt; {
    test('check table components', () =&gt; {
      render(
        &lt;MemoryRouter initialEntries={['/mina']}&gt;
          &lt;Routes&gt;
            &lt;Route path=&quot;/mina&quot; element={&lt;MineTable /&gt;} /&gt;
          &lt;/Routes&gt;
        &lt;/MemoryRouter&gt;,
      );
      const pageTitle = screen.getByRole('heading', { name: /mina/i });
      expect(pageTitle).toBeInTheDocument();
    });
  </code></pre>
  <p>Only the first test works, the second don't render the page MineTable, keeps rendering the last page Login. It's like the history of the first test render remains. Someone can help me? I want to test every page component of my application.</p>