dillon1000/react

Commit

Don’t error when returning an empty Fragment (#12966)

* Don’t error when returning an empty Fragment

When a fragment is reconciled, we directly move onto it’s children.
Since an empty `<React.Fragment/>` will have children of `undefined`,
this would always throw.

To fix this, we bail out in those cases.

* Test the update path as well

* Reuse existing code path

* An even more explicit solution that also fixes Flow
Browse files
Changed paths2 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactDOMFiber-test.js ModifiedM packages/react-reconciler/src/ReactChildFiber.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…