Skip to content

react/no-unused-state broken for class fields #2076

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
TzviPM opened this issue Dec 6, 2018 · 1 comment
Closed

react/no-unused-state broken for class fields #2076

TzviPM opened this issue Dec 6, 2018 · 1 comment

Comments

@TzviPM
Copy link

TzviPM commented Dec 6, 2018

If a piece of state is used within an ES7 property initializer whose value is an arrow function, react/no-unused-state still reports the state as unused. For example:

screen shot 2018-12-06 at 2 12 12 pm

screen shot 2018-12-06 at 2 12 32 pm

@ljharb
Copy link
Member

ljharb commented Dec 6, 2018

ES7 is ES2016 - you might be thinking of "class fields", which is a stage 3 proposal (ie, it's ES Nothing Yet).

Thanks, we'll try to repro this.

@ljharb ljharb changed the title react/no-unused-state broken for ES7 property intializers react/no-unused-state broken for class fields Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants