Reputation: 1389
I have two module firebase
and react-native-firebase
I want import both ,how can do that?
import firebase from 'firebase'
import {firebase as firebase2} from 'react-native-firebase';
when i want use it
const messaging=firebase2.messaging()
error:Unhandled JS Exception: TypeError: undefined is not an object (evaluating '_reactNativeFirebase.firebase.messaging')
Upvotes: 2
Views: 139
Reputation: 602
Import the Messaging package into your project:
import messaging from '@react-native-firebase/messaging';
The package also provides access to the firebase instance:
import { firebase as firebase2 } from '@react-native-firebase/messaging';
Upvotes: 1