I have a Form and I'm entering some data to the fields and submitting data to backend using OnSubmit method, After submission I wanted to see my page with already submitted data. Instead page is reloading with previous item. I tried to pass new object with all the latest values to form in the Key attribute. But Form is not reloading with the new data that I supplied.
my code like this.
//submit method
var option;
const SubmitData = async (request, e) => {
option = request;
try{
await postData(request).unwrap().then(() => )
}
}
// Form
render={(formRenderProps) => (
<div><FormElement>------</FormElement></div>)}
I'm creating a global variable and trying to pass it in the key. IS this a correct approach? Or key value should match with initialValues(varibale names) - data structure inside both are same.
Please help