UNPKG

rc-hooks

Version:
14 lines (13 loc) 273 B
function getRef(ref) { if (typeof ref === 'function') { // @ts-ignore return ref(); } else if (typeof ref === 'object' && ref && 'current' in ref) { return ref.current; } else { return ref; } } export default getRef;