dillon1000/react
Commit
Browse files Restrict effect return type to a function or nothing (#14119)
* Restrict effect return type to a function or nothing We already warn in dev if the wrong type is returned. This updates the Flow type. * Restrict return type further * Assume Effect hook returns either a function or undefined * Tweak warning message
Changed paths6 files
First-parent comparisonpackages/react-debug-tools/src/ReactDebugHooks.js ModifiedM packages/react-dom/src/server/ReactPartialRendererHooks.js ModifiedM packages/react-reconciler/src/ReactFiberCommitWork.js ModifiedM packages/react-reconciler/src/ReactFiberHooks.js ModifiedM packages/react-reconciler/src/__tests__/ReactHooks-test.internal.js ModifiedM packages/react/src/ReactHooks.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…