UNPKG

@caesar1030/react-analytics

Version:
17 lines (16 loc) 390 B
import { Children as i, cloneElement as m } from "react"; import { useGAEvent as p } from "./react-analytics.es10.js"; function E({ children: o, eventName: e, eventParams: t, enabled: r = !0 }) { const { handleEvent: l } = p({ eventName: e, eventParams: t, enabled: r }), n = i.only(o); return m(n, { onClick: (c) => l(c, n.props.onClick) }); } export { E as GAEvent };