"use strict";const t=require("react");function l(e){const u=t.useRef(null),r=t.useRef(void 0),c=t.useCallback(n=>{if(typeof e=="function"){const f=e,o=f(n);return()=>{typeof o=="function"?o():f(null)}}else if(e)return e.current=n,()=>{e.current=null}},[e]);return t.useMemo(()=>({get current(){return u.current},set current(n){u.current=n,r.current&&(r.current(),r.current=void 0),n!=null&&(r.current=c(n))}}),[c])}exports.$df56164dff5785e2$export$4338b53315abf666=l;
//# sourceMappingURL=useObjectRef-4v2MxSjQ.cjs.js.map
