dillon1000/react
Commit
Browse files [crud] Merge useResourceEffect into useEffect (#32205)
Merges the useResourceEffect API into useEffect while keeping the underlying implementation the same. useResourceEffect will be removed in the next diff. To fork between behavior we rely on a `typeof` check for the updater or destroy function in addition to the CRUD feature flag. This does now have to be checked every time (instead of inlined statically like before due to them being different hooks) which will incur some non-zero amount (possibly negligble) of overhead for every effect. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32205). * #32206 * __->__ #32205
Changed paths9 files
First-parent comparisonpackages/react-debug-tools/src/ReactDebugHooks.js ModifiedM packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js ModifiedM packages/react-reconciler/src/ReactFiberCallUserSpace.js ModifiedM packages/react-reconciler/src/ReactFiberCommitEffects.js ModifiedM packages/react-reconciler/src/ReactFiberHooks.js ModifiedM packages/react-reconciler/src/ReactInternalTypes.js ModifiedM packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js ModifiedM packages/react/src/ReactHooks.js ModifiedM scripts/error-codes/codes.json ModifiedPatch
Files changed
Rendering syntax-highlighted changes…