Performance: Effect execution timing
MEDIUM IMPACT
This affects how quickly side effects run after rendering, impacting interaction responsiveness and visual updates.
useEffect(() => {
fetchData();
}, []);useEffect(() => {
fetchData();
});| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| useEffect with empty deps | Minimal, runs once | Single reflow | Low paint cost | [OK] Good |
| useEffect without deps | Runs every render | Multiple reflows | High paint cost | [X] Bad |
| useLayoutEffect heavy work | Blocks DOM updates | Blocks reflow | Blocks paint | [X] Bad |
| useEffect heavy work | Runs after paint | No blocking reflow | Paint not blocked | [!] OK |