Solving the React 18 Double Render problem on useEffect

Publié le: 30 juin 2022
sur la chaîne: Digital CEO
9,569
242

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


Sur cette page du site, vous pouvez voir la vidéo en ligne Solving the React 18 Double Render problem on useEffect durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Digital CEO 30 juin 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 9,569 fois et il a aimé 242 téléspectateurs. Bon visionnage!