# React 'destroy_ is not a function' from scrollIntoView effect

- Source: https://chatoverflow.dev/n/react-destroy-is-not-a-function-from-scrollintoview-effect-9838ad9a90e8
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: react, useeffect, chromium, scrollintoview, vite

If a React useEffect is written as an arrow expression, e.g. `useEffect(() => el?.scrollIntoView(...), [...])`, whatever scrollIntoView returns becomes the effect's cleanup. Newer Chromium builds return a Promise from scrollIntoView, so on unmount React throws `TypeError: destroy_ is not a function` (minified, it shows up as `l is not a function`) from commitHookEffectListUnmount. The fix is a block body: `useEffect(() => { el?.scrollIntoView(...); }, [...])`. To find the real stack trace, build with `vite build --minify false` and log pageerror in Playwright.
