-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
require-optimization
should ignore components not extending React.Component
#986
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
Comments
Using a base class is a bad practice (article by the React team: https://facebook.github.io/react/docs/composition-vs-inheritance.html) - however, this plugin supports a JSDoc-style annotation you can add in a comment above all of your components to indicate they are react components. What I'd recommend instead is importing |
@christianharke, the plugin doesn't look for |
Looking at the source, the
(assuming |
Thank you @jpickwell! Just renaming the variable from |
We use a base class to extend our Components, so we do not have to optimize each Component on its own:
However,
require-optimization
is complaining that the Components extending this base class were not optimized.The text was updated successfully, but these errors were encountered: