If you click any of the buttons in our app really fast, you’ll see this error.
setState inside the asynchronous
All works if our component is around to get updated but, when we click faster than the request can resolve, the component that requested it isn’t around to be updated.
Our app has put another component there.
Clean up your shit, Todd!
When we see this error, it means we did setup that we need to clean up. We do cleanup in the componentWillUnmount lifecycle method.
Maybe next year…
I’ve updated the code below but cancellable
fetch is a whole thing and I’ve got eggnog to drink.
Happy holidays and have a Merry Christmas!