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

Ignore warnings when exporting a MobX observer component #59

Open
HorusGoul opened this issue Nov 19, 2024 · 1 comment · May be fixed by #60
Open

Ignore warnings when exporting a MobX observer component #59

HorusGoul opened this issue Nov 19, 2024 · 1 comment · May be fixed by #60

Comments

@HorusGoul
Copy link

Like #51, the mobx-react-lite works with high order components to connect components to MobX stores.

See the docs: https://mobx.js.org/react-integration.html

Workaround
As a workaround, I patched the package to add observer to the reactHOCs list:

const reactHOCs = new Set(["memo", "forwardRef"]);

Ideal solution
A way to configure additional HOCs.

@ArnaudBarre
Copy link
Owner

Seems like a legit usecase. Instead of adding it directly, I think a new option make sens here for others/future librairies with similar pattern.

I'll keep it in my backlog, but if you want to contribute, feel free to send a PR similar to https://github.com/ArnaudBarre/eslint-plugin-react-refresh/pull/55/files?w=1!

@HorusGoul HorusGoul linked a pull request Nov 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants