← React Intermediate Questions - Set 4 Q33
React Intermediate Questions - Set 4
1 2 3 4 5
useEffect(() => { let alive = true; fetchData().then(d => { if (alive) setData(d); }); return () => { alive = false; }; }, []);