I am trying to use React Hooks context to update a view which is bound to properties in an array of objects. Do I need to create a separate state handler for each property or clone the array to trigger the rendering. What would be a best practice performance wise?
As a basic example of what I am trying to achieve: I have the following objectA
objectA {
msg: string,
subObjects: objectA[]
}
The App:
App -> Textfield (bound to objectA:msg) App -> SubComponent -> TextField (x many and each one bound to subObject.msg) App -> ViewComponent -> Show objectA with subObjects (update whenever input changes)
Whenever a textfield is updated (the main textfield or any of the subcomponent textfields) objectA should be updated correspondingly and the ViewComponent should display the changes.