in my react.js project I am using Ant design and I need to fill in my form in modal with values from state when the form is showed. Consider the following code sandbox: SANDBOX
Here we have modal with title field and value of title stored in state:
formfields:{
title: "Some Title Here"
}
So when the form is showed I need the title field filled with Some Title Here
. The main problem is that I dont want to place value
of <Input>
as this.state.formfields.title
, so I dont want the state to update on every keystroke. Actually I need only take the data from state when the form is showed and update the state only when the form is submitted. No state updates should occur when the user inputs data into form fields. I checked some kind of THIS and THIS but it did not seem to work (maybe because of modal, anyway I dont know whether it is correct to do this like that).
Any ideas would be welcome. Thank you.