UNPKG

@react-md/utils

Version:
19 lines 452 B
/** * A small utility function that allows me to apply a passed in ref along with * my own custom ref logic. * * @param instance - The DOM Node instance * @param ref - The prop ref */ export function applyRef(instance, ref) { if (!ref) { return; } if (typeof ref === "function") { ref(instance); } else if (typeof ref === "object") { ref.current = instance; } } //# sourceMappingURL=applyRef.js.map