const setRef = (ref, instance) => {
if (typeof ref === 'function') {
ref(instance);
}
else if (ref !== null && ref !== undefined) {
ref.current = instance;
}
};
const composeRefs = (...refs) => (instance) => refs.forEach(ref => setRef(ref, instance));
export { composeRefs };