dillon1000/react
Commit
Browse files Support Context as renderable node (#25641)
## Based on #25634 Like promises, this adds support for Context as a React node. In this initial implementation, the context dependency is added to the parent of child node. This allows the parent to re-reconcile its children when the context updates, so that it can delete the old node if the identity of the child has changed (i.e. if the key or type of an element has changed). But it also means that the parent will replay its entire begin phase. Ideally React would delete the old node and mount the new node without reconciling all the children. I'll leave this for a future optimization.
Changed paths5 files
First-parent comparisonpackages/react-dom/src/__tests__/ReactDOMFizzServer-test.js ModifiedM packages/react-reconciler/src/ReactChildFiber.js ModifiedM packages/react-reconciler/src/ReactFiberNewContext.js ModifiedM packages/react-reconciler/src/__tests__/ReactUse-test.js ModifiedM packages/react-server/src/ReactFizzServer.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…