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

[New] no-string-refs: allow this.refs in > 18.3.0 #3807

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

henryqdineen
Copy link
Contributor

In React version 18.3.0 they released a change to support writing to this.refs. In the React 19 RC Upgrade Guide they suggest running a codemod that will remove the string ref usage but still use this.refs, which can cause false positives for the no-string-refs rule.

My PR simply tests the React version before checking the MemberExpression. Thanks!

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bizarre decision on their part, but this seems correct. Thanks!

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.76%. Comparing base (a2306e7) to head (5f8e578).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3807      +/-   ##
==========================================
+ Coverage   97.49%   97.76%   +0.27%     
==========================================
  Files         132      135       +3     
  Lines        9707     9721      +14     
  Branches     3554     3554              
==========================================
+ Hits         9464     9504      +40     
+ Misses        243      217      -26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ljharb ljharb merged commit c48cb1f into jsx-eslint:master Sep 3, 2024
343 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants