How I could test location with MemoryRouter on React Router DOM v6?

Using React Router DOM (v6) with React Testing Library, I would like to know if there’s a way to deal with “mocked” history from createMemoryHistoryor an alternative like it.

Based on the example of Testing Library, I could mock the history on the Router component but in v6 this component doesn’t accept the history prop anymore.

So, my doubt is: how can I test history and location with RTL (React Testing Library) with React Router DOM v6? Should I keep using the MemoryRouter?