dillon1000/react

Commit

[fail] Only warn on unacted effects for strict / non sync modes (#16041)

* only warn on unacted effects for strict / non sync modes

(basically, when `fiber.mode !== 0b0000`)

Warnings on unacted effects may be too noisy, especially for legacy apps. This PR fires the warning only when in a non sync mode (concurrent/batched), or when in strict mode. This should make updating easier.

I also added batched mode tests to the act() suite.

* explicitly check for modes before warning, explicit tests for all modes
Browse files
Changed paths4 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactDOMHooks-test.js ModifiedM packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.js ModifiedM packages/react-reconciler/src/__tests__/ReactHooks-test.internal.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…