dillon1000/react
Commit
Browse files act: Batch updates, even in legacy roots (#21797)
In legacy roots, if an update originates outside of `batchedUpdates`, check if it's inside an `act` scope; if so, treat it as if it were batched. This is only necessary in legacy roots because in concurrent roots, updates are batched by default. With this change, the Test Utils and Test Renderer versions of `act` are nothing more than aliases of the isomorphic API (still not exposed, but will likely be the recommended API that replaces the others).
Changed paths8 files
First-parent comparisonpackages/react-devtools-shared/src/__tests__/inspectedElement-test.js ModifiedM packages/react-dom/src/test-utils/ReactTestUtils.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.new.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.old.js ModifiedM packages/react-reconciler/src/__tests__/ReactIsomorphicAct-test.js ModifiedM packages/react-test-renderer/src/ReactTestRenderer.js ModifiedM packages/react/src/ReactAct.js ModifiedM packages/react/src/ReactCurrentActQueue.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…