Skip to content
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

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

Open
Rendez opened this issue May 4, 2020 · 0 comments
Open

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

Rendez opened this issue May 4, 2020 · 0 comments

Comments

@Rendez
Copy link

Rendez commented May 4, 2020

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant