We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Related to #1610, which doesn't completed catch all the cases.
With version 7.10.0 when the callback calls a function which references this.state.
myFunc = () => { this.setState({ ...prop, }, () => this.doStuff()); } doStuff= () => { console.log(this.state.asdf); }
Can work around this by just passing this.state into doStuff: this.doStuff(this.state)
this.doStuff(this.state)
The text was updated successfully, but these errors were encountered:
You definitely don't ever want to pass around the props or state object; we need to get this fixed.
Sorry, something went wrong.
Also seeing this, and have found I can work around it by using destructuring:
this.setState({ ...stuff }, () => { const { asdf } = this.state; console.log(asdf); });
Has it been fixed?
@jaybekster nope, that's why the issue is still open
+1 for interest in fixing.
Working properly with versions:
"babel-eslint": "^10.1.0" "eslint": "^7.4.0" "eslint-plugin-react": "^7.20.3"
253a62a
No branches or pull requests
Related to #1610, which doesn't completed catch all the cases.
With version 7.10.0 when the callback calls a function which references this.state.
Can work around this by just passing this.state into doStuff:
this.doStuff(this.state)
The text was updated successfully, but these errors were encountered: