React: Create a Controlled Form (event handler)

Hey Coder,

can someone tell me why the following code is valid:

handleSubmit(event) {
event.preventDefault();
this.setState({
input: ‘’,
submit: this.state.input
});
}

My understanding is, that the eventhandler resets the input-state and submits the input-state.
Will the reset appear after the submit is executed?
My mind can`t understand the progress.

Best regards
T.B.

@tb47, which challenge (or other place) do you see this code?

Also, can you wrap your code between ``` like this, so it’s easier to read?

https:/uploads/default/original/2X/4/470db50cc014204906db4a54e53a7442df544643.gif

As mentioned in the topic :slightly_smiling_face: