babel-plugin-transform-react-remove-prop-types icon indicating copy to clipboard operation
babel-plugin-transform-react-remove-prop-types copied to clipboard

Not working for SFC forwardRef() and createContext()

Open Rendez opened this issue 5 years ago • 0 comments

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.

Rendez avatar May 04 '20 11:05 Rendez