-
With v5, I could create a memory history object, execute some code, and then inspect the results: const history = createMemoryHistory({ initialEntries });
render(
<Router history={history}>
<MyComponent />
</Router>,
);
// ...do some stuff that triggers redirections, etc...
expect(history.location.search).toMatch(/desired/); Is there any way to do something similar in React Router v6? I see where I can pass initial state in to MemoryRouter, but I don't see any way to get the current state back out. |
Beta Was this translation helpful? Give feedback.
Answered by
timdorr
Jan 5, 2022
Replies: 1 comment
Answer selected by
joshkel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#8264 (comment)