Hi, I'm hoping to get some pointers here on how to solve my issue. I couldn't come up with a more suitable place. If questions are out of scope or otherwise inappropriate then feel free to get rid of this.
I'm building a form which is built based on data received from an API call. I'm not sure why, but I just can't get my head around the right approach!
The data is in the following form:
forms: [{
sections: [{
subSections: [{
fields: [field]
}]
}]
}]
Fields can be text, numbers, dates, select or multiselect.
Sections, subsections etc. have their own meta information (e.g. required, max length, id, type).
Here's what I've tried:
1) Loop the arrays and use Fieldset to create the form on the fly
Problems:
2) Build the form using action creators.
Problems:
I'm currently thinking about doing the redux thing and flattening the datastructure, but I'm not sure whether that is required or a good approach.
My question probably is: what would you do if you had to build a form based on such data? I'm locked in some wrong way of thinking which keeps me from seeing the solution.
I'm actually in the process of making a Google Forms clone built on React-Redux-Form - so look for that this weekend! Should be exactly what you're trying to do.
That sounds fantastic! Thank you for a quick reply!
Hello David, I'm contacting you to make sure I've not missed the clone. I understand that you are very busy and I do not wish to put pressure on you in case you didn't have the time to finish the project.
Most helpful comment
I'm actually in the process of making a Google Forms clone built on React-Redux-Form - so look for that this weekend! Should be exactly what you're trying to do.