Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import React from 'react';
// basically Exclude<React.ClassAttributes<T>["ref"], string>
var updateRef = function updateRef(ref, value) {
if (typeof ref === 'function') {
ref(value);
return;
}
ref.current = value;
};
var useComposedRef = function useComposedRef(libRef, userRef) {
var prevUserRef = React.useRef();
return React.useCallback(function (instance) {
libRef.current = instance;
if (prevUserRef.current) {
updateRef(prevUserRef.current, null);
}
prevUserRef.current = userRef;
if (!userRef) {
return;
}
updateRef(userRef, instance);
}, [userRef]);
};
export { useComposedRef as default };