Kiho / react-form-builder

A complete react form builder that interfaces with a json endpoint to load and save generated forms. The toolbox contains 16 items for gathering data. Everything from star ratings to signature boxes!
MIT License
473 stars 351 forks source link

dynamically change the answer data #298

Open ajay1800spirits opened 8 months ago

ajay1800spirits commented 8 months ago

How to dynamically change the answer_data? As in I built a form and I want to update certain inputs based on other inputs and using the onChange prop in the reactFormGenerator component update the answer_data's value using a state variable. And while my state variable is updated correctly the answer_data is not changing. My option currently is to force re-render the form and using the key prop in reactFormGenerator and have its value change for everytime onChange is called forcing a re-render. Is there a cleaner way to dynamically change the answer_data in the form?