Converting Between React Object and Data Structure

I am creating a dynamic table in React which update fields based on user inputs in other fields. There is a React object which contains information on all the fields. I would like to use information on certain fields to update other fields. I was thinking of doing the following:

  1. Create a data structure with the initial values for the table
  2. Convert the data structure into a React object which would be rendered
  3. When the user types in an editable field, that changes the React object. That would then be used to update the data structure.
  4. Computations would be done with the data structure to get table values. The data structure would be updated with the new table values
  5. The data structure would be used to update the React object.

I don’t know if this just make sit unnecessarily complicated or if this is a good approach. (The alternative I think would be to do computations by getting values from and updating the React objects directly).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.