rc-hooks
Version:
React Hooks Library.
16 lines (15 loc) • 353 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
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;
}
}
exports.default = getRef;