@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
17 lines (16 loc) • 418 B
JavaScript
;
exports.__esModule = true;
exports.default = mergeRefs;
function mergeRefs(refs) {
return value => {
refs.forEach(ref => {
if (typeof ref === "function") {
ref(value);
} else if (ref != null && typeof ref !== "string") {
// @ts-expect-error expected to be mutable
// eslint-disable-next-line no-param-reassign
ref.current = value;
}
});
};
}