arrow_backBACK TO DRILLS
Black BeltstrictmodePREMIUM
AbortController Signal Aborted by StrictMode Double-Invoke in useEffect
This effect fetches data and aborts the request on cleanup.
REACT_MODULE // 0x42
useEffect(() => {
const controller = new AbortController();
fetch('/api/data', { signal: controller.signal })
.then(res => res.json())
.then(setData)
.catch(err => {
if (err.name !== 'AbortError') console.error(err);
});
return () => controller.abort();
}, []);Under React 18 StrictMode in development, this can intermittently throw an unhandled DOMException before data ever arrives. Why?