Now we only swap for html comment anchors for the first HTML element in the HIG context. Lower level components do not do this so that React can reconcile children relative to each other correctly. This means that React is reconciling on an orphaned fragment of DOM elements, but it works fine!
The second piece of code here improves the HIGNodeList to manage the entire child node lifecycle. This means it's easy to create a collection of children in a component just by delegating certain methods to the HIGNodeList.
How Has This Been Tested?
I added a new test for inserting a child node in between two other nodes in the Tabs.test
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Fixes #222
Description
Motivation and Context
Previously we were swapping the created react DOM instance with an HTML comment to keep the document free from extraneous divs. This was causing a problem in the React stack renderer here: https://github.com/facebook/react/blob/b1768b5a48d1f82e4ef4150e0036c5f846d3758a/src/renderers/dom/stack/client/DOMChildrenOperations.js#L48 because insertBefore was inserting the DOM elements incorrectly (with an orphaned element reference)
Now we only swap for html comment anchors for the first HTML element in the HIG context. Lower level components do not do this so that React can reconcile children relative to each other correctly. This means that React is reconciling on an orphaned fragment of DOM elements, but it works fine!
The second piece of code here improves the HIGNodeList to manage the entire child node lifecycle. This means it's easy to create a collection of children in a component just by delegating certain methods to the HIGNodeList.
How Has This Been Tested?
I added a new test for inserting a child node in between two other nodes in the Tabs.test
Types of changes
Checklist: