Skip to content

Conversation

@bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jul 7, 2018

I've seen a few places where the forwardRef API was misunderstood and misused. Maybe this warning can help catch them?

I didn't differentiate between an arity of zero or one. Seemed better to keep the warning simple.

I could add a link to the forwardRef API docs if we think it would be helpful? Although none of the other warnings do this.

@bvaughn bvaughn merged commit 095dd50 into facebook:master Jul 7, 2018
@bvaughn bvaughn deleted the forwardRef-arity-warning branch July 7, 2018 15:11
@gaearon gaearon mentioned this pull request Sep 5, 2018
NMinhNguyen referenced this pull request in enzymejs/react-shallow-renderer Jan 29, 2020
…168)

* Add DEV warning if forwardRef function doesn't use the ref param
* Fixed a forwardRef arity warning in another test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants