Saturday 7 November 2020

Problem to install Mixpanel SDK - React Native

I need to configure the mixpanel in my work and for that I created a test project to understand how to configure the mixpanel SDK.

I followed the basic examples in the documentation. https://github.com/davodesign84/react-native-mixpanel

But I'm having a problem: 'null is not an object (evaluating RNMixpnael.sharedInstanceWithToken)'.

this is my code:

import React from 'react';
import {
  SafeAreaView,
  Text,
  StatusBar,
} from 'react-native';

import Mixpanel from 'react-native-mixpanel';

Mixpanel.sharedInstanceWithToken("MY_PROJECT_TOKEN");

const App: () => React$Node = () => {
  return (
    <>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
       <Text>Testing Mixpanel SDK</Text>
      </SafeAreaView>
    </>
  );
};

export default App;

And the error:

enter image description here

Could someone help me understand what I'm doing wrong?



from Problem to install Mixpanel SDK - React Native

No comments:

Post a Comment