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:
/ 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
On this page of the site you can watch the video online Solving the React 18 Double Render problem on useEffect with a duration of hours minute second in good quality, which was uploaded by the user Digital CEO 30 June 2022, share the link with friends and acquaintances, this video has already been watched 9,569 times on youtube and it was liked by 242 viewers. Enjoy your viewing!