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

__RouterContext doesn't be exported from v5.2.0 react-rotuer-dom? #7393

Closed
yongholeeme opened this issue Jun 2, 2020 · 3 comments
Closed

Comments

@yongholeeme
Copy link

I read the issue that history is separated from its own context (#7103).
From the result of that, __RouterContext doesn't be exported from v5.2.0 react-rotuer-dom? @_@

Acutally, I have used __RouterContext for making own custom hooks because there not exists hooks before 5.1.0 @@... from this update(5.2.0), that does not export __RouterContext @@...now I have to refactor all my code If I want to use latest vesion

@timdorr
Copy link
Member

timdorr commented Jun 2, 2020

We haven't changed the exports from react-router-dom.

@timdorr timdorr closed this as completed Jun 2, 2020
@jedwards1211
Copy link

jedwards1211 commented Jun 22, 2020

@timdorr yes you have, react-router-dom used to export * from 'react-router', then it was changed to only export some things explicitly here: e951e1d. That change caused __RouterContext to no longer be exported.

I know it's not public API, but the current sad state of affairs is that the convenience of making our own hooks to get stuff from __RouterContext outweighs the inevitable disruption of using non-public API. There's a serious need for making the context officially supported API or adding a public hooks API.

@flip-it
Copy link

flip-it commented Oct 13, 2020

It's still available in react-router, which you can import from instead of react-router-dom.

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

4 participants