dillon1000/react

Commit

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
Browse files
Changed paths6 files
First-parent comparison
M packages/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 Modified
Patch

Files changed

Rendering syntax-highlighted changes…