dillon1000/react
Commit
Browse files flush work on exiting outermost act(), with nested act()s from different renderers (#16181)
Given this snippet:
```jsx
TestRenderer.act(() => {
TestUtils.act(() => {
TestRenderer.create(<Effecty />);
});
});
```
We want to make sure that all work is only flushed on exiting the outermost act().
Now, naively doing this based on actingScopeDepth would work with a mocked scheduler, where flushAll() would flush all work across renderers.
This doesn't work without mocking the scheduler though; and where flushing work only works per renderer. So we disable this behaviour for a non-mocked scenario. This seems like an ok tradeoff.Changed paths4 files
First-parent comparisonfixtures/dom/src/index.test.js ModifiedM packages/react-dom/src/test-utils/ReactTestUtilsAct.js ModifiedM packages/react-noop-renderer/src/createReactNoop.js ModifiedM packages/react-test-renderer/src/ReactTestRendererAct.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…