You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
503 B

import _typeof from "@babel/runtime/helpers/typeof";
export function fillRef(ref, node) {
if (typeof ref === 'function') {
ref(node);
} else if (_typeof(ref) === 'object' && ref && 'current' in ref) {
ref.current = node;
}
}
export function composeRef() {
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
refs[_key] = arguments[_key];
}
return function (node) {
refs.forEach(function (ref) {
fillRef(ref, node);
});
};
}