@kayelaa/canvas API - v0.2.15
    Preparing search index...

    Function useDisposableRef

    • 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.

      Type Parameters

      • T

        Type of the ref's value

      Parameters

      • initialValue: T

        Initial value for .current

      Returns KaylaRef<T>

      A fresh KaylaRef instance

      const temp = useDisposableRef({ count: 0 });
      // temp.current is only valid for this render