persona-community-5/.pnpm-store/v3/files/25/476df6524224e77a22ae4d1b08336d2ad8dd0914884c7aa549bef9220d7426c8aa697c2e7977bbfe0190b44c9fb3bcc5be60d7355a5ec196986ba435d0cdae
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

15 lines
449 B
Plaintext

import { assignRef } from './assignRef';
import { createCallbackRef } from './createRef';
/**
* Transforms one ref to another
* @example
* ```tsx
* const ResizableWithRef = forwardRef((props, ref) =>
* <Resizable {...props} ref={transformRef(ref, i => i ? i.resizable : null)}/>
* );
* ```
*/
export function transformRef(ref, transformer) {
return createCallbackRef(function (value) { return assignRef(ref, transformer(value)); });
}