Exercise 2: Why Angular and Vue "Converged" While React "Stands Apart" — Possible Solution ==================================================================== THE UNDERLYING DIFFERENCE: HOW EACH ONE RE-RENDERS ------------------------------ Per this lesson's "The Same Component, Three Ways" section: React's counter re-runs the ENTIRE Counter() function on every state change - "re-run the whole function on each render." Angular's signal() and Vue's ref() work differently: they are fine-grained reactive values that track exactly which parts of the output actually depend on them, updating only those parts directly rather than re-running a whole function body. WHY THIS MAKES ANGULAR AND VUE LOOK ALIKE ------------------------------ Because signal()/computed() (Angular) and ref()/computed() (Vue) are both built on the same fine-grained reactivity idea, their code ends up looking almost identical - a value wrapped in a reactive container, plus a computed() derived from it. The lesson notes this directly: "both fine-grained reactive systems." WHY REACT NEEDS useMemo/useCallback AS A CONSEQUENCE ------------------------------ Because React re-runs the whole function on every render, a value that doesn't actually need to be recalculated (like the derived `double` in the example) still gets recomputed every single time by default - along with any function or object created inside the component. In a small counter this is trivial, but in a larger component it can mean real wasted work, and functions passed to children get a NEW identity every render (breaking simple equality checks child components may rely on). useMemo() and useCallback() exist specifically to opt back out of that automatic full-rebuild by manually pinning a value or function so it doesn't get recreated unless its own dependencies actually change - the kind of optimization Angular's signals and Vue's refs get automatically because they only ever touch the parts that genuinely depend on the changed value in the first place. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly names full-function-rerun (React) versus fine-grained reactive tracking (Angular/Vue) as the actual mechanism, explains why that mechanism makes Angular and Vue's code look alike, and derives useMemo/useCallback's purpose directly from that mechanism rather than describing them as an unrelated, arbitrary React feature.