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
react/prefer-stateless-function with PureComponent. #1773
Comments
Scenario and codesandbox here: apollographql/react-apollo#1938 |
Can you paste the actual warning message (and denote the line it points to)? |
Separately, if you truly only want to render once, you’d want a normal class component with a shouldComponentUpdate that returns false. |
All the component is in warning:
|
@johnunclesam what if you |
In if (list[component].hasSCU && list[component].usePropsOrContext) {
continue;
} But,I find that |
I have the same problem. Doesn't matter if I extend |
I have the same problem. ignorePureComponents: true doesn't seem to do anything. Doesn't matter if I extend PureComponent or React.PureComponent. |
Same problem here as well. If you add props or anything beyond a simple |
As the option, if you are experimenting with views you can avoid this error writing:
|
This bug need some attention :) |
The fix is merged on the current version v7.12.4 ? |
No, the pr was merged 18 days ago while v7.12.4 is released 3 months ago. |
Thank you! |
I'm using:
"react/prefer-stateless-function": [1, { "ignorePureComponents": true }]
but I'm also using this new
Query
component byreact-apollo
:So, why this is a warning? (Or an error if I disable
ignorePureComponents
?)I just need PureComponent because I don't need to re-render
DogsLove
component every time I switch Route. I need it to render just one time, the first time. ThenQuery
component is making an observable and nothing more.Where am I wrong?
The text was updated successfully, but these errors were encountered: