import * as React from "react";
import { isReactVersionAtLeast } from "./reactVersion.js";
function getReactElementRef(element) {
  if (!/* @__PURE__ */ React.isValidElement(element)) {
    return null;
  }
  const reactElement = element;
  const propsWithRef = reactElement.props;
  return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
}
export {
  getReactElementRef
};
//# sourceMappingURL=getReactElementRef.js.map
