dillon1000/react

Commit

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.
Browse files
Changed paths2 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberCommitWork.js ModifiedM packages/react-reconciler/src/__tests__/ReactHooks-test.internal.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…