Sometimes you have an useEffect that needs to do some cleanup work and that sounds very abstract so let me give you a more concrete example. Let's say that we execute a function in a useEffect hook that essentially is executed on every keystroke, like in the following example:
Read