Answer the question
In order to leave comments, you need to log in
How to change state on form submission?
Good day, friends!
Help me to understand.
Now when you click on the Publish button, everything is sent fine
. I need that when you click on save, the state changes to status 'D'
My state
state = {
data: {
status: 'P'
}
}
<form onSubmit={this.onSubmit}>
<input type='submit'>Опубликовать</span>
<span>Сохранить</span>
</form>
onSubmit = e => {
this.props.submit(this.state.data)
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question