Sometimes you understand a technology best when you stop using it and start asking why it works.

I’ve been working with Vue for quite a while now, and like most developers, I’ve spent a lot of time using its reactive APIs without thinking too deeply about what happens underneath.

ref reactive computed watch

They become muscle memory.

You write the code, the UI updates, and you move on.

Recently, while working on one of my applications, I found myself questioning something very simple:

If one object inside an array changes, what exactly does Vue update?

It sounds like a small question.

It sent me down a much deeper rabbit hole.

And the more I read about how Vue’s reactivity works, the more I appreciated the design decisions behind it.

Originally published on Medium in Level Up Coding.

The problem I was actually solving

One of the applications I’ve been building is heavily configuration-driven.

Instead of manually creating every form field, I have metadata describing them:

{
  id: 'country',
  name: 'country',
  label: 'Country',
  type: 'select',
  placeholder: 'Select country'
}

The UI consumes this metadata and renders the appropriate component.

Something roughly like:

<InputField
  v-for="field in fields"
  :key="field.id"
  :field="field"
/>

This becomes particularly interesting with select inputs.

Some options are static:

options: [
  { label: 'Active', value: 'ACTIVE' },
  { label: 'Inactive', value: 'INACTIVE' }
]

Others come from reference data returned by APIs.

That reference data lives in a Pinia store.

So instead of modifying my original configuration, I derive the data needed by the UI through a computed property.

Conceptually:

const fields = computed(() => {
  return metadata.map((field) => {
    // enrich field with dynamic reference data
    // resolve dependent options
    // return UI-ready metadata
  })
})

This works beautifully.

But then I started thinking about what happens when something changes.

What happens when one object changes?

Imagine the following:

const users = ref([
  { id: 1, name: 'John', age: 25 },
  { id: 2, name: 'Jane', age: 30 },
  { id: 3, name: 'Bob', age: 40 },
])

And:

<div
  v-for="user in users"
  :key="user.id"
>
  <h3>{{ user.name }}</h3>
  <p>{{ user.age }}</p>
</div>

Now I change:

users.value[1].age = 31

Does Vue rebuild the entire list?

Does it recreate all three DOM elements?

Does it somehow know that only Jane’s age changed?

The answer is a little more nuanced than “Vue only re-renders one element.”

And understanding that distinction is important.

Rendering and updating aren’t the same thing

When reactive state changes, Vue’s rendering effect can run again and produce a new virtual DOM representation.

But that does not mean Vue throws away the existing DOM and recreates everything.

Vue compares the new virtual DOM with the previous one.

Conceptually:

Reactive state changes
        ↓
Render function runs
        ↓
New virtual DOM
        ↓
Diff against previous virtual DOM
        ↓
Patch only what changed
        ↓
Real DOM

So in our example, Vue can determine that:

  • John / 25 didn’t change.
  • Jane / 30 → 31 changed.
  • Bob / 40 didn’t change.

The existing DOM nodes are reused.

Only the affected part needs to be patched.

That distinction changed how I thought about Vue’s performance.

But the really interesting part is reactivity

The virtual DOM isn’t the most interesting part to me anymore.

The interesting part is how Vue knows what depends on what.

Vue 3’s reactivity system is built around JavaScript Proxies and dependency tracking.

When reactive state is accessed, Vue can track that relationship.

When reactive state changes, Vue can trigger the effects that depend on it.

Very roughly:

state.country
     ↓
computed field metadata
     ↓
State select
     ↓
DOM

Change country, and the dependent computation becomes invalid.

That’s incredibly useful for the kind of UI I build.

This is where computed properties become really powerful

Consider a cascading dropdown.

You might have:

Country
   ↓
State
   ↓
City

The state options depend on the selected country.

The city options depend on the selected state.

My metadata can describe that dependency:

{
  id: 'state',
  type: 'select',
  dependsOn: ['country']
}

And my computed metadata resolves the actual options based on the current form state.

So when form.country changes, the computed value is invalidated and the dependent options are recalculated.

I don’t have to manually tell Vue:

“Hey, the state dropdown needs to update now.”

The dependency is already present in the computation.

That is one of those things that feels almost boring when you’re using Vue.

Once you understand what’s happening underneath, it’s actually quite elegant.

Then I started thinking about React

This is where the comparison gets interesting.

I’m not saying React is bad.

Far from it.

React is an incredibly capable library, and its ecosystem is enormous.

But Vue and React approach reactivity from fundamentally different directions.

Consider a simplified React component:

function User() {
  return (
    <>
      <h1>{user.name}</h1>
      <p>{user.age}</p>
    </>
  )
}

When state changes, React’s basic model is roughly:

State changes
     ↓
Component function runs again
     ↓
New element tree
     ↓
Reconciliation
     ↓
DOM updates

The important distinction is that running the component function and updating the DOM are two different things.

React can execute a component again without actually changing the corresponding DOM.

And React has become very good at optimizing this process.

Techniques such as memo, useMemo, useCallback, selector-based state management, and newer compiler-based optimizations can reduce unnecessary work.

So React is absolutely capable of building extremely fast applications.

But the mental model is different.

Vue feels more like a dependency graph

With Vue, I tend to think about the application like this:

Reactive state
      │
      ├──────→ Component A
      │
      ├──────→ Computed B
      │
      └──────→ Component C

The reactive system tracks relationships between state and consumers.

That makes the following kind of code feel very natural:

const filteredItems = computed(() => {
  return items.value.filter(
    item => item.category === selectedCategory.value,
  )
})

The computed value depends on:

  • items
  • selectedCategory

Change either one, and Vue knows the computed value needs to be invalidated.

It’s declarative dependency management.

React feels more like re-executing a description of the UI

The React mental model is different.

You describe what the UI should look like for the current state.

When state changes, React can run the relevant component logic again and reconcile the result.

This model has enormous advantages.

It’s simple.

It’s predictable.

And it has allowed React to become one of the most successful UI libraries ever created.

But personally, I find Vue’s reactive model particularly pleasant for applications with lots of derived state.

Especially enterprise applications.

And this matters for configuration-driven applications

This is where my original question became relevant again.

My forms aren’t enormous.

They’re split into smaller subforms.

Each subform has its own metadata and computed state.

Reference data is loaded into Pinia when the application initializes.

Dynamic options are resolved through dictionary-style lookups rather than repeatedly scanning large collections.

Dependent fields declare their dependencies.

The UI simply consumes the resulting metadata.

So when reference data changes or a user changes a parent selection, Vue’s reactivity system naturally propagates the relevant changes.

The architecture becomes something like:

API
 ↓
Pinia reference store
 ↓
Reactive form state
 ↓
Computed metadata
 ↓
Generic input components
 ↓
DOM

And I don’t need every layer to manually notify the next layer.

The dependencies are expressed through the data itself.

That’s the part I really like.

I don’t think Vue is “faster than React”

After going down this rabbit hole, I actually became more careful about saying things like:

“Vue is faster than React.”

That’s an oversimplification.

There are benchmarks where one wins and benchmarks where the other wins.

There are applications where the difference is irrelevant.

There are also architectural decisions that matter far more than the framework.

A poorly designed Vue application can absolutely be slower than a well-designed React application.

And React has continued improving its rendering and compilation story significantly.

The more accurate statement is:

Vue and React have different approaches to managing UI updates, and Vue’s fine-grained reactivity can make certain kinds of state-heavy applications particularly pleasant to build.

That’s a much more useful distinction.

What surprised me most

The funny thing is that I wasn’t trying to optimize my application when I started looking into this.

I was simply curious.

I had a computed property.

It returned an array of metadata.

That array was rendered with v-for.

Some properties depended on Pinia state.

Some select options depended on other form values.

And I suddenly wondered:

“Am I accidentally making Vue recompute and rerender everything whenever one field changes?”

The answer was nuanced.

Yes, the rendering process can run again.

No, Vue doesn’t blindly recreate the entire DOM.

And the reactive dependency tracking allows Vue to efficiently propagate changes through the parts of the application that actually depend on them.

Once I understood that, I stopped worrying about the architecture I had built.

More importantly, I understood why it worked.

Good abstractions become even better when you understand the machinery underneath

This is probably my biggest takeaway.

As developers, we often use abstractions without understanding how they work.

We write:

computed(...)

and move on.

We write:

v-for

and move on.

We write:

store.someReferenceData

and move on.

That’s perfectly fine most of the time.

But occasionally, it’s worth stopping and asking:

“What is actually happening here?”

Understanding the machinery underneath makes you better at designing with the abstraction.

I didn’t change my architecture after learning more about Vue’s reactivity.

Instead, I became more confident in it.

And that’s arguably more valuable.

Vue’s reactivity is one of those features you appreciate more the deeper you go

When I first started using Vue, reactivity was simply one of the things that made Vue convenient.

Now I see it differently.

It’s not just:

“Change a variable and the UI updates.”

It’s a dependency-tracking system that allows you to build layers of derived state without manually coordinating every update.

For configuration-driven enterprise applications, that’s incredibly useful.

And perhaps that’s why Vue continues to feel so natural to me.

I don’t spend much time thinking:

“How do I make this component re-render?”

I spend more time thinking:

“What does this piece of UI depend on?”

Once that relationship is expressed correctly, Vue takes care of the propagation.

The framework matters less than understanding the model

I still wouldn’t choose Vue over React simply because of reactivity.

There are many factors involved:

  • ecosystem
  • team expertise
  • hiring
  • platform requirements
  • tooling
  • architecture
  • project constraints

But understanding the difference between their models has made me appreciate Vue much more.

And it reminded me of something I’ve learned repeatedly as an engineer:

The best abstractions are the ones you can use without thinking about their complexity—but understand well enough to reason about when something goes wrong.

Vue’s reactivity is one of those abstractions for me.

I used it for years.

Then one day I stopped and asked:

“How does this actually work?”

I’m glad I did.

Because now, when I look at a seemingly simple computed property driving a configuration-heavy UI, I don’t just see some framework magic.

I see a carefully designed reactive system doing exactly what it was built to do.

Thanks for reading.

Happy coding!