Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add forwardRef as a valid component definition #311

Merged
merged 2 commits into from
Dec 7, 2018

Conversation

eps1lon
Copy link
Contributor

@eps1lon eps1lon commented Nov 26, 2018

  • recognizes React.forwardRef as a valid component in a hoc
  • adds support for propTypes and defaultProps for React.forwardRef components

Started out as a simple fix to recognize export default hoc(React.forwardRef(...)) until I realized that forwardRef is not supported in propTypes handler.

I can split those two up if you want to (moving propTypes to fixture 14 and simply using 18 as the hoc+forwardRef fixture). As far as I understood the codebase this needs to be ported to every resolver? I haven't used flow in over a year so everything flow related (as most of the other additions) is just copy and paste.

@danez
Copy link
Collaborator

danez commented Dec 7, 2018

Thank you.

@danez danez merged commit b048d58 into reactjs:master Dec 7, 2018
@eps1lon eps1lon deleted the test/hoc-and-forwardRef branch December 11, 2018 08:39
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants