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

Require Optimization breaks when using arrow function Fix #2385

Merged
merged 1 commit into from Aug 17, 2019

Conversation

jenil94
Copy link
Contributor

@jenil94 jenil94 commented Aug 17, 2019

Fixes #2374

Issue
require-optimization breaks when using arrow function in class components.

What went wrong
When we encounter ArrowFunctionExpression we blindly calls markSCUAsDeclared. In case of functional components it works fine, but in case of class based components, calling markSCUAsDeclared sets SCU declared for that component as true.

Added a check, if ArrowFunctionExpression is part of a class, then ignore it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Arrow functions breaks require-optimization
2 participants