react-ga4
react-ga4 copied to clipboard
Uncaught TypeError: import_react_ga4.default.initialize is not a function
Hi,
With: import ReactGA from 'react-ga4'; ReactGA.initialize('G-8XZ6X4KJQH');
I am having this error Uncaught TypeError: import_react_ga4.default.initialize is not a function
It seems to work if I use ReactGA.default.initialize('G-8XZ6X4KJQH');
using ESBuild 0.15.12
Thanks
I'm experiencing the same issue. Also using esbuild.
This is probably due to the fact that you have type: module in your package.json. You can read more here https://esbuild.github.io/content-types/#default-interop)
Did anyone managed to workaround this ?