We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Isn't passing value enough?
value
Here: https://github.com/ReactTraining/react-workshop/blob/13748e43467581c2933dbd878f1cc1aef6a08263/subjects/07-Compound-Components/solution.js#L62-L66
Can do this instead:
select(value) { this.setState({ value }, () => { this.props.onChange(value); // no need to do this.state.value }); }
Also having eslint installed would have flagged that value as an unused param.
The text was updated successfully, but these errors were encountered:
You can do either one. this.state.value makes it clear that we're grabbing the value from this.state after it has been updated.
this.state.value
this.state
The value param is used in the setState call, so it's not unused.
setState
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Isn't passing
value
enough?Here:
https://github.com/ReactTraining/react-workshop/blob/13748e43467581c2933dbd878f1cc1aef6a08263/subjects/07-Compound-Components/solution.js#L62-L66
Can do this instead:
Also having eslint installed would have flagged that
value
as an unused param.The text was updated successfully, but these errors were encountered: