fix:Incorrect Usage of setState in React Challenge (#39290)

* fix:Incorrect Usaage of setState in React Challenge

* apply suggestion

* also set stage usage in other challenges

* fix setState usage in challenges

* correct syntax

* correct usage of useState in other files

* add current message to state

* remove current message from state

* change connect redux to the message app

* remove extra space
This commit is contained in:
Ruchi Kushwaha
2020-08-11 22:42:27 +05:30
committed by GitHub
parent 817325d68e
commit 35c3609489
8 changed files with 55 additions and 45 deletions

View File

@@ -120,9 +120,9 @@ class MyForm extends React.Component {
}
handleSubmit(event) {
event.preventDefault()
this.setState({
submit: this.state.input
});
this.setState((state) => ({
submit: state.input
}));
}
render() {
return (