Skip to content

Add forwardRef as a valid component definition - #311

Merged
danez merged 2 commits into
reactjs:masterfrom
eps1lon:test/hoc-and-forwardRef
Dec 7, 2018
Merged

Add forwardRef as a valid component definition#311
danez merged 2 commits into
reactjs:masterfrom
eps1lon:test/hoc-and-forwardRef

Conversation

@eps1lon

@eps1lon eps1lon commented Nov 26, 2018

Copy link
Copy Markdown
Member
  • 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

danez commented Dec 7, 2018

Copy link
Copy Markdown
Collaborator

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants