PHP 7.4.33
Preview: useTransformRef.js Size: 725 B
/var/www/gtechmarathon2026.bitkit.dk/httpdocs/node_modules/use-callback-ref/dist/es2015/useTransformRef.js
import { assignRef } from './assignRef';
import { useCallbackRef } from './useRef';
/**
 * Create a _lense_ on Ref, making it possible to transform ref value
 * @param {ReactRef} ref
 * @param {Function} transformer. 👉 Ref would be __NOT updated__ on `transformer` update.
 * @returns {RefObject}
 *
 * @see https://github.com/theKashey/use-callback-ref#usetransformref-to-replace-reactuseimperativehandle
 * @example
 *
 * const ResizableWithRef = forwardRef((props, ref) =>
 *  <Resizable {...props} ref={useTransformRef(ref, i => i ? i.resizable : null)}/>
 * );
 */
export function useTransformRef(ref, transformer) {
    return useCallbackRef(null, function (value) { return assignRef(ref, transformer(value)); });
}

Directory Contents

Dirs: 0 × Files: 20
Name Size Perms Modified Actions
502 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
556 B lrw-r--r-- 2025-07-10 12:54:55
Edit Download
357 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
549 B lrw-r--r-- 2025-07-10 12:54:55
Edit Download
386 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
449 B lrw-r--r-- 2025-07-10 12:54:55
Edit Download
645 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
735 B lrw-r--r-- 2025-07-10 12:54:55
Edit Download
714 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
1.20 KB lrw-r--r-- 2025-07-10 12:54:56
Edit Download
376 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
449 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
301 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
11 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
737 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
1.74 KB lrw-r--r-- 2025-07-10 12:54:56
Edit Download
707 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
1.18 KB lrw-r--r-- 2025-07-10 12:54:56
Edit Download
655 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
725 B lrw-r--r-- 2025-07-10 12:54:56
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).