-
Notifications
You must be signed in to change notification settings - Fork 160
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
Support contexts #3
Comments
Not really sure we should do it here, at least before context API becomes stable:
This means that there should be at most one place in an app which encapsulates context usage. |
A new Context API is currently being worked on and (if I'm understanding right) should bring stability to this feature once finished. Details on this can be found at the official proposal and in the corresponding pull request. This new API for Context has been merged and is set behind a feature flag at the moment. |
The new Context API was released with 16.3.0 version. |
I have started working on React 16.3 compatibility, but would love to see contributions. Currently overwhelmed with work and this isn't a top priority. |
There's an open pull request to add Typescript definitions for this API on Definitely Typed waiting to be merged; this is what it looks like:
but when I run that through ts2kt the output isn't usable because it leaves the Provider and Consumer undefined. Here's the output I get:
I've spent some time trying to torture this into compiling but haven't been successful. I don't have much experience doing this type of thing though. |
Context API is supported as of 16.3.1-pre.26: 7709872, enjoy! |
Woohoo! Thanks so much! |
https://reactjs.org/docs/context.html
The text was updated successfully, but these errors were encountered: