Framework Reactivity: React, Vue, Svelte, and Solid
Most content teaches what APIs do. Senior-level engineering focuses on what work the runtime performs and why. Use this page to reason from mechanics, not framework slogans.
Quick Decision Guide
Reactivity = dependency tracking + scheduling + minimal DOM updates.
React: Re-render components, diff trees, then commit DOM changes. Vue: Track property dependencies and trigger only subscribed effects. Svelte: Shift dependency work to compile time. Solid: Update exact signal dependents with fine-grained precision.
Interview signal: Framework syntax is secondary; performance reasoning is primary.
Engineering Mental Model (Use This Everywhere)
🔥 Insight
Good engineers separate framework syntax from reactivity mechanics.
🧠Mental Model
All frameworks solve the same 3-part loop:
1. Track dependencies
2. Schedule updates
3. Commit minimal DOM changes
How It Works
State change
-> framework scheduler
-> DOM mutation
-> Style
-> Layout
-> Paint
-> CompositeCommon Mistakes
🎯 Interview Takeaway
If you can explain where work happens and why, you can compare any frontend framework convincingly.
React Reactivity (Official Model)
🔥 Insight
React does not track what changed ahead of time. It re-runs components and figures it out afterward.
🧠Mental Model
React UI is a function of state:
UI = f(state)How It Works
setState
-> schedule update
-> render phase (pure compute)
-> reconciliation (tree diff)
-> commit phase (DOM mutations)function Counter() {
const [count, setCount] = useState(0)
return <button onClick={() => setCount(c => c + 1)}>{count}</button>
}Trade-offs
Common Mistakes
🎯 Interview Takeaway
Re-renders are not automatically bad; unnecessary work is bad. Explain identity (keys), boundaries, and batching.
Vue Reactivity (Proxy + Effects)
🔥 Insight
Vue tracks dependencies automatically, but if you lose reactive references, you lose reactivity.
🧠Mental Model
Reads are tracked, writes trigger only dependent effects/computations.
How It Works
const state = reactive({ count: 0 })
watchEffect(() => {
console.log(state.count)
})const doubled = computed(() => state.count * 2)Edge Case
const { count } = state // breaks reactive linkageUse toRefs(state) or toRef when destructuring.
Trade-offs
🎯 Interview Takeaway
Strong Vue answers mention both the power (fine-grained updates) and the caveat (reference integrity).
Svelte and Solid (Two Fast Paths)
🔥 Insight
Svelte shifts reactivity to build time; Solid keeps it explicit at runtime with signal graphs.
Svelte Mental Model
Assignments mark invalidation, compiler emits targeted updates.
<script>
let count = 0
$: doubled = count * 2
</script>assignment
-> compiler-emitted invalidation
-> targeted DOM patchSolid Mental Model
Signals create explicit dependency edges.
const [count, setCount] = createSignal(0)
createEffect(() => {
console.log(count())
})setSignal
-> notify dependents
-> update exact subscribed nodesTrade-offs
🎯 Interview Takeaway
Different mechanisms, same objective: minimize unnecessary work while preserving correctness.
Reactivity vs Change Detection + Scheduling
🔥 Insight
A fast rendering model can still feel slow if scheduling and state boundaries are poor.
Reactivity vs Broad Scanning
Older dirty-checking models repeatedly scan broad state surfaces. Modern reactive systems track dependencies and target updates.
Scheduling (Senior-Level Signal)
User input
-> JS task
-> framework batching/prioritization
-> DOM commit
-> browser frame pipeline🎯 Interview Takeaway
Show that you understand both update granularity and scheduling strategy. That is senior-level reasoning.
What Interviewers Actually Test
🚀 Interview Signals
Interviewers are usually testing whether you can reason about:
🧠Senior-Level Insight
Most performance issues come from state placement and rendering boundaries, not framework choice alone.
Practical Checklist
🎯 Interview Takeaway
Answer with mechanics, trade-offs, and constraints, not framework marketing. That is what stands out.