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.

gaearon
gaearon approved these changes Jul 7, 2018
@bvaughn bvaughn merged commit 095dd50 into facebook:master Jul 7, 2018
1 check passed
Loading
@bvaughn bvaughn deleted the forwardRef-arity-warning branch Jul 7, 2018
TejasQ pushed a commit to TejasQ/react that referenced this issue Aug 26, 2018
…ebook#13168)

* Add DEV warning if forwardRef function doesn't use the ref param
* Fixed a forwardRef arity warning in another test
@gaearon gaearon mentioned this pull request Sep 5, 2018
NMinhNguyen referenced this issue 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants