All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.utils.compose-refs.cjs Maven / Gradle / Ivy

Go to download

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