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

Legacy context usage prints warnings in React StrictMode #22

Open
petevk opened this issue May 5, 2020 · 3 comments
Open

Legacy context usage prints warnings in React StrictMode #22

petevk opened this issue May 5, 2020 · 3 comments

Comments

@petevk
Copy link

petevk commented May 5, 2020

I noticed when using rheostat that this project is printing warnings in React StrictMode because it's using the legacy React Context instead of the one released in React 16.3. I understand this library would like to continue supporting React <16.3, but it also prevents using concurrent mode when that is eventually released into stable.

What is the long term strategy for releasing this library? Should there be a new major version/forked library which supports React 16.3+? Is it possible to feature-detect the new Context API and use that if it's available?

@ljharb
Copy link
Collaborator

ljharb commented May 5, 2020

If it's possible, a PR would be very welcome - otherwise it would require a breaking change.

@petevk
Copy link
Author

petevk commented May 18, 2020

It seems like such a thing is possible with this library -- https://github.com/jamiebuilds/create-react-context (or the smaller https://github.com/StringEpsilon/mini-create-react-context). I found it because some other libraries like react-router use it to support both React 15 and 16+.

@Hamzaalam
Copy link

I'm facing the similar issue while using it, it may due to "withDirectionPropTypes", it should fix with Context API
image

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

3 participants