-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
isReactComponent()
returns false for components without render()
#174
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
For ES5 classes we can simplify the detection and just rely on the React.createClass presence, it would solve your problem. But for ES6 classes it is more difficult since there is no real difference between a standard ES6 class and a React component, that why currently we just search for a class with a render method that return some JSX (or null). |
Just ran into this same problem, we have a something along the lines of;
|
So I'm running into this issue in a slightly different variant. I'm actually looking at running
Because the render contains compiled JSX rather than actual JSX, it gets skipped. |
It might be useful to check out react-codemod's ReactUtils to see the methods they use for this kind of thing. |
I'm going to close this; in general, component detection needs some work, but there's been many updates since this was filed. New issues with concrete and actionable improvements are welcome! |
I have few components which
render()
method encapsulated into mixin.Like so:
And because of that some rules are ignored (e.g.
sort-comp
rule).So I propose to check when there is no
render()
method inside component if themixins
prop is declared or not.The text was updated successfully, but these errors were encountered: