useShallowRef<T>(initialValue: T | (() => T)): ShallowRef<T>
The hook version of shallowRef from @vue/reactivity.
In addition to values accepted by shallowRef, you can also pass an initializer function returning the value.
This hook version allows the ref to be created when the component first renders, then cached for future re-renders.
If you pass in an initializer function, it will only be called on first render.
The hook version of
shallowRef
from@vue/reactivity
. In addition to values accepted byshallowRef
, you can also pass an initializer function returning the value.This hook version allows the ref to be created when the component first renders, then cached for future re-renders. If you pass in an initializer function, it will only be called on first render.
Shallow version of ().
Example
See
https://vuejs.org/api/reactivity-advanced.html#shallowref