vue-lynx / markRaw

Function: markRaw()

function markRaw<T>(value): Raw<T>

Marks an object so that it will never be converted to a proxy. Returns the object itself.

Type Parameters

Type Parameter
T extends object

Parameters

ParameterTypeDescription
valueTThe object to be marked as "raw".

Returns

Raw<T>

Example

const foo = markRaw({})
console.log(isReactive(reactive(foo))) // false

// also works when nested inside other reactive objects
const bar = reactive({ foo })
console.log(isReactive(bar.foo)) // false

Warning: markRaw() together with the shallow APIs such as shallowReactive allow you to selectively opt-out of the default deep reactive/readonly conversion and embed raw, non-proxied objects in your state graph.

See

https://vuejs.org/api/reactivity-advanced.html#markraw

Defined in

node_modules/.pnpm/@vue+reactivity@3.5.30/node_modules/@vue/reactivity/dist/reactivity.d.ts:235