-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Perf] component detection: improve performance by avoiding traversing parents unnecessarily #3459
Conversation
…g parents unnecessarily
return <Text>{this.props.foo}</Text>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be reported because React.createClass
is not the correct pragma here. So there should be no component detected thus no report.
Codecov Report
@@ Coverage Diff @@
## master #3459 +/- ##
==========================================
- Coverage 97.58% 97.54% -0.05%
==========================================
Files 127 127
Lines 9068 9066 -2
Branches 3308 3307 -1
==========================================
- Hits 8849 8843 -6
- Misses 219 223 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -871,7 +877,7 @@ function componentRule(rule, context) { | |||
return; | |||
} | |||
|
|||
node = utils.getParentComponent(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to find parent components here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems legit, thanks
d6ece7f
to
bf59919
Compare
…g parents unnecessarily (jsx-eslint#3459)
This change makes an
eslint .
withplugin:react/all
enabled run about 13% faster.