import { forwardRef } from "react"; export const DivForm = forwardRef< HTMLFormElement, React.DetailedHTMLProps< React.HTMLAttributes, HTMLFormElement > & { tag: "form" | "div" } >((arg, ref) => { const props = { ...arg } as any; delete props.tag; if (arg.tag === "div") { if (props.onSubmit) delete props.onSubmit; return (
{arg.children}
); } return (
{arg?.children}
); });