---
title: defineModel Value Changes Apply After Next Tick
impact: MEDIUM
impactDescription: Reading model.value immediately after setting it returns the old value, not the new one
type: gotcha
tags: [vue3, v-model, defineModel, reactivity, timing, nextTick]
---
# defineModel Value Changes Apply After Next Tick
**Impact: MEDIUM** - When you assign a new value to a `defineModel()` ref, the change doesn't take effect immediately. Reading `model.value` right after assignment still returns the previous value. The new value is only available after Vue's next tick.
This can cause bugs when you need to perform operations with the updated value immediately after changing it.
## Task Checklist
- [ ] Don't read model.value immediately after setting it expecting the new value
- [ ] Use the value you assigned directly instead of re-reading from model
- [ ] Use nextTick() if you must read the updated value after assignment
- [ ] Consider batching related updates together
**Incorrect - Expecting immediate value update:**
```vue
```
**Correct - Use the value directly:**
```vue
```
**Alternative - Use nextTick for deferred operations:**
```vue
```
## Why This Happens
`defineModel` uses Vue's internal synchronization mechanism (`watchSyncEffect`) to sync with the parent. When you assign to `model.value`:
1. The local ref updates
2. An `update:modelValue` event is emitted to parent
3. Parent updates its ref
4. Vue syncs back to child in the next tick
During this cycle, the child's local value briefly differs from what's been committed.
## Pattern: Object Updates with Immediate Access
```vue
```
## Watch Callbacks Also See Updated Values
```vue
```
## Reference
- [Vue.js Reactivity - nextTick](https://vuejs.org/api/general.html#nexttick)
- [Vue.js Component v-model](https://vuejs.org/guide/components/v-model.html)
- [SIMPL Engineering: Vue defineModel Pitfalls](https://engineering.simpl.de/post/vue_definemodel/)