Skip to content

Can't validate value prop of Context Provider using PropTypes #12636

@SamSamskies

Description

@SamSamskies

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

screen shot 2018-04-17 at 8 36 13 pm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions