Current section: useEffect 16 exercises
Problem

Replace React's useEffect With Your Own

Transcript

00:00 Kelly, the co-worker, has done us a nice thing and added a use effect in our code base. Right now, it's using the built-in React hook, and so it is working, working just as you would expect. Consider yourself effective. But we want to delete that and implement it from scratch ourselves. You're going to need to have a hook ID

00:19 to store these different effects, and then you're going to need to flush the rendering synchronously using the flush sync API. Then just iterate over all the use effects with the callback. So again, we're going to have another bucket that stores all of our effect callbacks. So, I think you can do this. Let's get into it.