tdesign-react
Version:
TDesign Component for React
30 lines (26 loc) • 992 B
JavaScript
/**
* tdesign v1.11.6
* (c) 2025 tdesign
* @license MIT
*/
import { _ as _typeof } from '../../_chunks/dep-9a3c539e.js';
import { isMemo } from 'react-is';
function supportRef(nodeOrComponent) {
var _type$prototype, _nodeOrComponent$prot;
var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
if (typeof type === "function" && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render)) {
return false;
}
if (typeof nodeOrComponent === "function" && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render)) {
return false;
}
return true;
}
function getRefDom(domRef) {
if (domRef.current && _typeof(domRef.current) === "object" && "currentElement" in domRef.current) {
return domRef.current.currentElement;
}
return domRef.current;
}
export { getRefDom, supportRef };
//# sourceMappingURL=ref.js.map