@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
12 lines • 317 B
JavaScript
export default function setRef(ref, node) {
// if its a function call it
if (typeof ref === "function") {
ref(node);
}
// otherwise we should treat it as a ref object
else if (ref != null) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
ref.current = node;
}
}