import { isValidElement } from "react";
function reactNodeToString(reactNode) {
  if (typeof reactNode === "string") {
    return reactNode;
  }
  if (typeof reactNode === "number") {
    return String(reactNode);
  }
  if (Array.isArray(reactNode)) {
    return reactNode.map((child) => reactNodeToString(child)).join("");
  }
  if (isValidElement(reactNode)) {
    return reactNodeToString(reactNode.props.children);
  }
  return "";
}
export {
  reactNodeToString
};
