-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
Can't validate value prop of Context Provider using PropTypes #12636
Comments
PR here: #12658 |
Fixed by @nicolevy in #12658 (comment) |
@gaearon @nicolevy @SamSamskies I didn't understand from the #12658 how to add props validation to context values. Can you please document this?
|
@damianobarbati Same with me, i have gone through it and didn't understand how to use it. An example would be appreciated. |
Hey @damianobarbati and @amitpatil321, check out an example here: https://codesandbox.io/s/1z1oxpx02j |
Do you want to request a feature or report a bug?
Not sure if this is a bug or a feature request.
What is the current behavior?
Can't validate value prop of a Context Provider using PropTypes
See CodeSandbox example here: https://codesandbox.io/s/1z1oxpx02j
What is the expected behavior?
Expected PropTypes violation warning in the console
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
v16.3.2
I'd be happy to implement this if others also wish it was possible to validate the value of the Context Provider using PropTypes. It would help if someone pointed me in the right direction though. I haven't dug into the React internals much yet.
The text was updated successfully, but these errors were encountered: