dillon1000/react

Commit

[Fiber] Add ReactDOMFiber.unstable_createPortal() (#8386)

* [Fiber] Add ReactDOMFiber.unstable_createPortal()

While #8368 added a version of `ReactDOM.unstable_renderSubtreeIntoContainer()` to Fiber, it is a bit hacky and, more importantly, incompatible with Fiber goals. Since it encourages performing portal work in lifecycles, it stretches the commit phase and prevents slicing that work, potentially negating Fiber benefits.

This PR adds a first version of a declarative API meant to replace `ReactDOM.unstable_renderSubtreeIntoContainer()`. The API is a declarative way to render subtrees into DOM node containers.

* Remove hacks related to output field
Browse files
Changed paths11 files
First-parent comparison
M scripts/fiber/tests-passing.txt ModifiedM src/renderers/dom/fiber/ReactDOMFiber.js ModifiedM src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js ModifiedM src/renderers/shared/fiber/ReactChildFiber.js ModifiedM src/renderers/shared/fiber/ReactFiber.js ModifiedM src/renderers/shared/fiber/ReactFiberBeginWork.js ModifiedM src/renderers/shared/fiber/ReactFiberCommitWork.js ModifiedM src/renderers/shared/fiber/ReactFiberCompleteWork.js ModifiedM src/renderers/shared/fiber/ReactTypeOfWork.js ModifiedA src/renderers/shared/fiber/isomorphic/ReactPortal.js AddedM src/renderers/shared/fiber/isomorphic/ReactTypes.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…