The application describes a layered structure, several levels of the tree of komponentov. The data is stored-loaded into a similar tree.
And stored and known by initialisatie applications only the object id and data for display asynchronously queried from a third-party API. Ie, when you open some object only visible to the first id of the child, and a half-seconds loaded avatars-names.
I see two options for transferring data inside:
- top-down using props to convey a complete data store-upgrade them at the top
- or to pass down your id, and each of the lower components, he will ask-you will get full data.
How best to proceed with data transmission to display: all props using top-down or independence of sub-components, each itself zaprashivat-receives-displays additional data?
The tree is edited in the process. On some of the levels you are adding the item. You can pass "up" user input, and there is a single component will update the appropriate node in the data tree; or in the leaf-component to handle input, query API, update handed over to props a piece of shared data?Question 2.
What to do when upgrading: to transmit "up" or again, alone in coponent stew? (question 2 is not very different from question 1 : )