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

Add DEV warning if forwardRef function doesn't use the ref param #13168

Merged
merged 2 commits into from
Jul 7, 2018

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