i've got a react app, using react router, and react testing library for the tests. i'm in the process of upgrading from react router v5.1 to v6.
i've got a test that verifies that something happens (a modal is dismissed) when the browser back button is clicked. in the old version of the test i used createMemoryRouter from the history package to simulate the back button press, something like this:
const history = createMemoryHistory();
render(
<Router history={history}>
<Route path="/">
<App />
</Route>
</Router>
);
// perform some setup
history.goBack();
// make assertions about state of application
but since v6 uses hooks to interact with the history it's not possible to pass a history object in like this. so what can i do to test my application's interaction with the back button?