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.
PR here: #12658
Fixed by @nicolevy in https://github.com/facebook/react/pull/12658#merged-event
@gaearon @nicolevy @SamSamskies I didn't understand from the #12658 how to add props validation to context values. Can you please document this?
export default class Form extends React.Component {
static contextType = context;
static propTypes = {
i do say I expect a "values" key in context which should in turn be an object?
};
@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
Most helpful comment
@gaearon @nicolevy @SamSamskies I didn't understand from the #12658 how to add props validation to context values. Can you please document this?