Avoid useEffect when you can calculate derived data during rendering. Effects are for synchronizing with external systems. For expensive pure calculations, calculate during render and use useMemo when you need to cache the result between renders.
Question 12 of 22 in useEffect