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
На этой странице сайта вы можете посмотреть видео онлайн Solving the React 18 Double Render problem on useEffect длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Digital CEO 30 Июнь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 9,569 раз и оно понравилось 242 зрителям. Приятного просмотра!