Creates a temporary ref object outside of component context.
Unlike useRef, this ref does not persist across entity refreshes — it is recreated every time the component function runs. Use for one-off values or render-pass temporaries.
useRef
Type of the ref's value
Initial value for .current
.current
A fresh KaylaRef instance
KaylaRef
const temp = useDisposableRef({ count: 0 });// temp.current is only valid for this render Copy
const temp = useDisposableRef({ count: 0 });// temp.current is only valid for this render
Creates a temporary ref object outside of component context.
Unlike
useRef, this ref does not persist across entity refreshes — it is recreated every time the component function runs. Use for one-off values or render-pass temporaries.