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

[ESLint] Assignment like foo.bar.baz = X should warn about foo.bar instead #15510

Closed
gaearon opened this issue Apr 26, 2019 · 2 comments · Fixed by #16784
Closed

[ESLint] Assignment like foo.bar.baz = X should warn about foo.bar instead #15510

gaearon opened this issue Apr 26, 2019 · 2 comments · Fixed by #16784
Labels

Comments

@gaearon
Copy link
Collaborator

gaearon commented Apr 26, 2019

  let foo = {}
  useEffect(() => {
    foo.bar.baz = 43;
  }, []);

This asks you to include foo.bar.baz into deps. But this doesn't make sense, as you write to it. Instead it should ask to include foo.bar into array.

If foo is a newly created object in render scope then we might additionally nudge you to useRef for it instead. Because otherwise it won't be shared between renders.

@eragon512
Copy link

hey, I'd like to take up this issue, however, I am not very familiar with the project setup, is that ok?

@eragon512
Copy link

hey @gaearon is this issue still available? how should I start work on this?

@necolas necolas added the React Core Team Opened by a member of the React Core Team label Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants