toRaw()
Returns the original, non-proxied object behind a reactive proxy.
Syntax
toRaw<T>(proxy: T): T Parameters
| Name | Type | Required | Description |
|---|---|---|---|
proxy | T | No | A reactive, readonly, or shallow proxy. |
Returns
T — The raw underlying object.
Examples
<script setup lang="ts">
import { reactive, toRaw } from 'vue';
const state = reactive({ count: 0 });
const raw = toRaw(state);
// mutate raw without triggering reactivity:
raw.count = 99;
</script>
Notes
toRaw escapes the reactivity system, returning the original object. Useful to
pass data to external libraries or to perform expensive mutations without
triggering effects. Mutating the raw object does not notify watchers; use
sparingly.