or . ' +
'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');
if (!previousRef) {
// When there is no ref on the element, use the new ref directly
return cloneElement(element, {
ref: newRef,
});
}
else {
return cloneElement(element, {
ref: (node) => {
setRef(previousRef, node);
setRef(newRef, node);
},
});
}
}