import type { Ref } from './types'; export function setRef(ref: Ref, value: T | null): void { if (typeof ref === 'function') { ref(value); } else if (ref != null) { ref.current = value; } }