{
accountDetail: {
accountStatus: "",
referralCode: "",
signUpRemarks: "",
adminRemarks: "",
accountStatusRemarks: ""
},
address: {
latLong: {
latitude: 0,
longitude: 0
},
locality: {
city: {
district: {
id: 55,
state: {
id: ""
}
},
id: 1683
},
id: 9
},
street: ""
},
businessDetail: {
businessName: "",
gstRegistered: true,
gstin: ""
},
}
PLEASE HELP
Hey Subho, If you are familiar with handling states or refs. You can update state values as soon as there is a change in the input field or use refs to construct that object once the form is submitted. If you need a more flexible solution with validation and usually for large forms, something like react-hook-form.com would help you a lot. Do check it out.
Girish Patil
Full-stack engineer
Yashu Mittal
Full Stack Dev
Here's a small example.
const onChangeHandler = e => { // store value in state }<input placeholder="Input field" onChange={onChangeHandler} />