Skip to content

Not working for SFC forwardRef() and createContext()Β #195

@Rendez

Description

@Rendez
const myComp = React.forwardRef(() => {...}); myComp.propTypes = {};
const context = React.createContext();
context.provider.propTypes = {}
  • The former doesn't work, but I am guessing could be an easy fix.
  • The latter doesn't contain JSX, so assigning propTypes to the provider doesn't work. An easy fix can be added IF we only account for propTypes assigned in the same file React.createContext() is used, which it normally should be, accounting for most of the cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions