package.dist.utils.compose-refs.cjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react Show documentation
Show all versions of react Show documentation
A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.
The newest version!
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function setRef(ref, value) {
if (typeof ref === "function") {
ref(value);
} else if (ref !== null && ref !== void 0) {
ref.current = value;
}
}
function composeRefs(...refs) {
return (node) => {
for (const ref of refs) {
setRef(ref, node);
}
};
}
exports.composeRefs = composeRefs;
© 2015 - 2025 Weber Informatics LLC | Privacy Policy