dillon1000/react
Commit
Browse files Don't use existing "root" ID if non-root
Before, if you had ``` container = <div data-reactid=".0"><div data-reactid=".0.0" /></div>; ``` and did `ReactDOM.render(<span />, container)` you would get ``` <div data-reactid=".0"><span data-reactid=".0" /></div>; ``` (along with a warning not to replace React-rendered children with a new tree like that). But that makes no sense -- the span should have a new index, not truncate the ID of the old child it's replacing. (Now tests pass again with useCreateElement on; before they threw a "valid but unequal" on our test for this warning.)
Changed paths1 file
First-parent comparisonsrc/renderers/dom/client/ReactMount.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…