-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(react): Add support for React Router createMemoryRouter
#14854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e479bde
to
9f1cd47
Compare
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
9f1cd47
to
6a7c1a0
Compare
I actually think this idea isn't too bad. 🤔 Would it be a lot of effort? |
6a7c1a0
to
358452f
Compare
54cb551
to
ea95f26
Compare
@lforst - Updated the PR to export |
initialEntries
in wrapped routers.createMemoryRouter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the liberty to do 2 functions instead of the boolean arg. I have seen that pattern go bad very quickly.
Otherwise looks great to me! We shouldn't forget to add docs.
Ref: #14814
I was not able to properly distinguish between the instances of
BrowserRouter
andMemoryRouter
. However, usinginitialEntries
withBrowserRouter
should break TypeScript where it's available. We can alternatively export a wrapper specific toMemoryRouter
if that makes better sense.