filmov
tv
Solving the React 18 Double Render problem on useEffect
Показать описание
React 18's useEffect hook now double renders (with the empty dependency array) which has caused a stir in the React community. First render animations and many packages have broke being unprepared for this change. useEffect with the empty dependency array is double rendering in React Strict Mode - but on purpose. In this video, we talk about what's happening with useEffect exactly, why React is doing this now in v18 and how to solve the useEffect double render "problem"
CONNECT ON MY DISCORD:
#react #useeffect #react18
0:00 Intro
0:50 useEffect demo before React 18
2:00 useEffect demo after React 18
2:30 What React 18 is doing and why
3:30 Developer misconceptions about useEffect
4:20 The problem with quick re-mounts on components
5:30 useEffect problems on double render
6:30 How to clean up useEffect to deal with a double render
9:00 Further problems if you try to remove React Strict Mode
12:30 Another example on cleaning up useEffect to deal with double render
14:00 Summary
CONNECT ON MY DISCORD:
#react #useeffect #react18
0:00 Intro
0:50 useEffect demo before React 18
2:00 useEffect demo after React 18
2:30 What React 18 is doing and why
3:30 Developer misconceptions about useEffect
4:20 The problem with quick re-mounts on components
5:30 useEffect problems on double render
6:30 How to clean up useEffect to deal with a double render
9:00 Further problems if you try to remove React Strict Mode
12:30 Another example on cleaning up useEffect to deal with double render
14:00 Summary
Комментарии