Skip to content

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

@geewoo94

Description

@geewoo94

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.

Activity

gaearon

gaearon commented on Apr 3, 2022

@gaearon
Collaborator

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @gaearon@geewoo94

      Issue actions

        Bug: [eslint-plugin-exhaustive-deps] can't find unstable value. · Issue #24268 · facebook/react