Skip to content
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

Is it possible to access the history bundled into React Router? #950

Closed
tom-ricci opened this issue Apr 26, 2022 · 1 comment
Closed

Is it possible to access the history bundled into React Router? #950

tom-ricci opened this issue Apr 26, 2022 · 1 comment

Comments

@tom-ricci
Copy link

I need to use <HistoryRouter/>, but on the RR docs it says:

This API is currently prefixed as unstable_ because you may unintentionally add two versions of the history library to your app, the one you have added to your package.json and whatever version React Router uses internally. If it is allowed by your tooling, it's recommended to not add history as a direct dependency and instead rely on the nested dependency from the react-router package. Once we have a mechanism to detect mis-matched versions, this API will remove its unstable_ prefix.

Is it possible to import the history package used in React Router to prevent this? Otherwise is there any way to work around this issue?

Also, if there's no way to prevent this problem, is there any work being done on the issue? I'd be interested in contributing to it if needed.

@tom-ricci
Copy link
Author

It turns out importing "history" will work as both RR and RR-DOM require it, meaning it gets brought up to the root of node_modules and is importable without specifying it in the package.json. Closing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant