React Lifecycle: Cleanup Functions
Medium
Determine console logs on mount and after button click. Question: What logs will appear on component mount and after clicking the button? Hints: • Cleanup functions run before re-running effect • useLayoutEffect cleanup runs before useEffect cleanup • Effect re-runs when dependencies change Acceptance Criteria: ✓ Correct logs on mount ✓ Correct logs after click ✓ Explanation of cleanup function order ✓ Understanding of useEffect dependencies