dillon1000/react
Commit
Browse files [Selective Hydration] ReactDOM.unstable_scheduleHydration(domNode) (#17004)
Adds an API to explicitly prioritize hydrating the path to a particular DOM node without relying on events to do it. The API uses the current scheduler priority to schedule it. For the same priority, the last one wins. This allows a similar effect as continuous events. This is useful for example to hydrate based on scroll position, or prioritize components that will upgrade to client-rendered-only content. I considered having an API that explicitly overrides the current target(s). However that makes it difficult to coordinate across components in an app. This just hydrates one target at a time but if it is blocked on I/O we could consider increasing priority of later targets too.
Changed paths4 files
First-parent comparisonpackages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js ModifiedM packages/react-dom/src/client/ReactDOM.js ModifiedM packages/react-dom/src/events/ReactDOMEventReplaying.js ModifiedM packages/react-reconciler/src/ReactFiberReconciler.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…