Skip to content

react/no-multi-comp false positives when declare class property memo keyword #2164

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

Closed
vdhieu opened this issue Feb 14, 2019 · 5 comments · Fixed by #2706
Closed

react/no-multi-comp false positives when declare class property memo keyword #2164

vdhieu opened this issue Feb 14, 2019 · 5 comments · Fixed by #2706

Comments

@vdhieu
Copy link

vdhieu commented Feb 14, 2019

The eslint-plugin-react version I use is 7.12.4

image

@ljharb
Copy link
Member

ljharb commented Feb 15, 2019

Does this only happen if the function is named memo?

@vdhieu
Copy link
Author

vdhieu commented Feb 15, 2019

@ljharb with the import name, too.

Actually I was used memo to name memorize-one package. I thought it might be because of the memorize-one so I created that memo function (as above) to test if it really because of the memorize-one

@ljharb
Copy link
Member

ljharb commented Feb 15, 2019

Right, but I mean if you name it something that's not "memo" - because React.memo is a special thing - does the lint rule still warn>?

@vdhieu
Copy link
Author

vdhieu commented Feb 15, 2019

Ah, if I use other name the warning will gone.

@ljharb
Copy link
Member

ljharb commented Feb 16, 2019

Thanks, in that case the issue is that the code checking for React.memo needs to also ensure memo comes from React.

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