You are viewing Pre-Alpha documentation. Some features may not work as expected.

toReactive
The toReactive utility function converts a MaybeRef object to a reactive proxy, automatically unwrapping ref values. It provides special handling for Map, Set, and regular objects.
Usage
import { ref } from 'vue'
import { toReactive } from '@vuetify/v0'
const state = ref({ name: 'John', age: 30 })
const rstate = toReactive(state)
console.log(rstate.name) // 'John' (no .value needed)API
| Composable | Description |
|---|---|
| toArray→ | Convert value to array |
| useProxyModel→ | Two-way binding with transformation |
toReactive
Type
function toReactive<Z extends object> ( objectRef: MaybeRef<Z> ): UnwrapNestedRefs<Z>Details
Converts a
MaybeRefto a reactive proxy that automatically unwraps ref values. Provides special handling for:- Map: Unwraps ref values when accessing via
get(), and updates existing refs when usingset() - Set: Unwraps ref values during iteration
- Objects/Arrays: Unwraps nested refs automatically
Z represents the type of the object being converted.
- Map: Unwraps ref values when accessing via