I am learning ReactJS and trying to understand the basic concepts. I started creating a prototype of the application I'm working on and has the following hierarchy
The page I'm working on will be an input form for the Client and all his siblings. Each of these sections will have some text inputs for placing data, so they looked like a natural place to place a hierarchy of components.
From all that I read about ReactJS, if you are going to manage state, you should do it in the general ancestor of all controls. This means that any changes in the child must bubble an event before the state custodian to handle the changes. Then this should update the state and any changes will be re-displayed. This makes sense in simple scenarios, but it leads me to my slightly more complex hierarchy.
- If any change occurs in one of many Addresses, should I release this event in place and then on the Client?
- If so, what is the best way to tell the state which particular address has changed?
- If you need to go through each level of the hierarchy, can it not do a lot of additional template to spread a simple change?
- onChange , ?
ReactLink (https://facebook.imtqy.com/react/docs/two-way-binding-helpers.html) , . , , . , , . , React , .