Hi! This repo contains the before & after code for the examples in Learn useEffect Over Lunch, a mini-course all about the useEffect hook.
Feel free to browse through the examples and check out the course to see how I build them up. It's 7 video lessons (about 48 mins) covering:
- What is a side effect, and why do we need useEffect?
- Fetching Data (and avoiding infinite loops
- Re-fetch data when a prop changes
- Create a custom hook for fetching data
- Refactor lifecycle methods to useEffect
- Websockets, extra dependencies, and the functional fix
- useEffect vs useLayoutEffect, and when to use each