Function: toRaw

index.toRaw

toRaw<T>(target): T

Unwraps a reactive Proxy or Signal to return the underlying raw JavaScript target object.

Type parameters

Name Description
T The type of the target object.

Parameters

Name Type Description
target T The reactive proxy, signal, or plain object to unwrap.

Returns

T

The original unproxied object reference.

Remarks

If the provided value is not a reactive Proxy or Signal, it is returned unchanged. Useful when passing data to external libraries that require unmodified references or when avoiding reactivity overhead.

Example

import { signal, toRaw } from '@banksia/signals';

const count = signal(0);
console.log(toRaw(count).value); // 0 (non-tracking read)