-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
context undefined while use ES6 constructor #6598
Comments
you should pass the second param:
|
@Linzerui it works, thanks a lot! |
Is this documented anywhere? I just went looking under https://facebook.github.io/react/docs/ but eventually got here via Google because I couldn't find it there... |
@depoulo I think there is no document for this, but you can inspired by the usage of context-in-stateless-functional-components |
Which is far from ideal, but thx anyway! |
Update for 16.x: passing context to constructor is not documented in 'current' documentation, I did find it in the legacy-documentation though. This leads me to believe it is deprecated. According to the new documentation in the section that links to the legacy-docs: "The old API will be supported in all 16.x releases, but applications using it should migrate to the new version. The legacy API will be removed in a future major React version." (Found here) |
Thank you! |
All issue in the code:
The react versioin is 15.0.1,i remember a previous version without this problem.
Is this a bug or the usage of my problem?
Here is my demo git:
https://github.com/shenyzore/react-demo.git
Thanks!
The text was updated successfully, but these errors were encountered: