Given
```js
function ThrowInEffect() {
  React.useEffect(() => {
    throw new Error('passive effect')
  }, [])
  return null;
}
```

In React 17 this error got logged to the console (and triggered the error overlay in create-react-app) regardless of whether `ThrowInEffect` was a child of an Error Boundary or not.

In React 18 (`createRoot` and legacy root API) an Error Boundary will prevent logging that error to the console (and not trigger the error overlay in create-react-app).

Errors during render work like they did in React 17.

Behavior in React 17: https://codesandbox.io/s/react-17-error-boundaries-vp21e?file=/src/index.js
Behavior in React 18: https://codesandbox.io/s/react-18-error-boundaries-psd56?file=/src/index.js


Recording of effect errors in React 17 and 18 and with and without Error Boundaries_

https://user-images.githubusercontent.com/12292047/122749780-053ced00-d28e-11eb-98ce-075dcdc53ee2.mp4


commitHydratedContainer,
  commitHydratedSuspenseInstance,
  clearContainer,
  prepareScope,
  prepareForCommit,
  beforeActiveInstanceBlur,
} from './ReactFiberHostConfig';
import {
  captureCommitPhaseError,
  resolveRetryWakeable,
  markCommitTimeOfFallback,
  enqueuePendingPassiveProfilerEffect,
  restorePendingrs,
} from './ReactFiberWorkLoop.new';
import {
  NoFlags as NoHookEffect,
  HasEffect as HookHasEffect,
  Layout as HookLayout,
  Passive as HookPassive,
} from './ReactHookEffectTags';
import {didWarnAboutReassigningProps} from './ReactFiberBeginWork.new';
import {doesFiberContain} from './ReactFiberTreeReflection';
let didWarnAboutUndefinedSnapshotBefore: Set<mixed> | null = null;
if (__DEV__) {
  didWarnAboutUndefinedSnapshotBefore = new Set();
}
 Used during the commit phase to track the state of the Offscreen component stack.
 Allows us to avoid traversing the return path to find the nearest Offscreen ancestor.
 Only used when enableSuspenseLayoutEffectSemantics is enabled.
let offscreenSubtreeIsHidden: boolean = false;