dillon1000/react
Commit
Browse files Warn for bad useEffect return value (#14069)
Mostly to catch this:
```js
useEffect(async () => {
// ...
return cleanup;
});
```
Is this too restrictive? Not sure if you would want to do like
```js
useEffect(() => ref.current.style.color = 'red');
```
which would give a false positive here. We can always relax it to only warn on Promises if people complain.Changed paths2 files
First-parent comparisonpackages/react-reconciler/src/ReactFiberCommitWork.js ModifiedM packages/react-reconciler/src/__tests__/ReactHooks-test.internal.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…