Getting order of descendent components in hierarchy

(Kieren Johnstone) #1

Effectively, I want to have child components which ‘know’ the order they appear in some ascendant component:

The above outlines my currently (hacky) approach using context. I’ve not had luck using React.Children to attempt to deep-clone either: redux connect()ed components don’t have props.children so aren’t recursed into.

Any tips?