TLDR Tech / Dev
Start naming your useEffect functions, you will thank me later
Naming your useEffect callbacks instead of leaving them as anonymous arrow functions makes it easy to skim a component's intent from function names alone. The naming also acts as a design forcing function. If you can't name an effect without “and,” it's doing too much, and if the best name sounds like internal state shuffling, it probably shouldn't be an effect at all.
Read the full story