Open ghasemikasra39 opened 4 years ago
so this is how i have it working. Granted i created a wrapper function.
import Mixpanel from 'react-native-mixpanel';
const logToMixpanel = (eventName: string, eventData = {}) => { if (isMixpanelEnabled()) { Mixpanel.sharedInstanceWithToken(mixpanelToken()).then(() => { Mixpanel.trackWithProperties(eventName, {...DataLayer, ...eventData}); }); } };
Dear @bpfeiffer187 Tested, getting the same error
I cannot believe that I have wasted hours with this.
The solution is:
import mixpanel from 'react-native-mixpanel';
instead of using require