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

Bug: [eslint-plugin-exhaustive-deps] can't find unstable value. #24268

Closed
geewoo94 opened this issue Apr 3, 2022 · 1 comment · Fixed by #24343
Closed

Bug: [eslint-plugin-exhaustive-deps] can't find unstable value. #24268

geewoo94 opened this issue Apr 3, 2022 · 1 comment · Fixed by #24343

Comments

@geewoo94
Copy link

geewoo94 commented Apr 3, 2022

React version: 18.0.0 (not important)

Steps To Reproduce

I'll show as a code.
스크린샷 2022-04-04 오전 12 01 05

Link to code example:
https://codesandbox.io/s/stupefied-raman-g6j3fi?file=/src/App.js

The current behavior

exhaustive-deps can't found unstable dependency.

The expected behavior

Warn lint message.

Opinion

I know this code is super weird but This code may be improved. something like

  • Add more core lint rule like 'useState is always declared as a const'
  • eslint-plugin-exhaustive-deps should find reallocation value. and calculate real value.
  • Or just stay it.

I just wonder what is your opinion. thank you.

@geewoo94 geewoo94 added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Apr 3, 2022
@gaearon
Copy link
Collaborator

gaearon commented Apr 3, 2022

Interesting find. If the binding is ever reassigned we should treat it as unstable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants