dillon1000/react
Commit
Browse files Move nodes around by reference instead of by index
This makes things easier if we ever want to use more than one DOM node for a component. Notably, this is more convenient if we want to remove the wrappers around text components (since text nodes can be split and joined however a browser feels like) or if we want to support returning more than one element from render (#2127). I left the old indexes so that implementations aren't forced to use the node/image if they prefer indices, because I'm not sure yet whether the changes corresponding to my rewrite of DOMChildrenOperations are easy or hard yet in React Native. (The tests pass with and without the DOMChildrenOperations changes here.)
Changed paths3 files
First-parent comparisonsrc/renderers/dom/client/utils/DOMChildrenOperations.js ModifiedM src/renderers/shared/reconciler/ReactChildReconciler.js ModifiedM src/renderers/shared/reconciler/ReactMultiChild.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…