user1723583
user1723583

Reputation: 573

using firebase in react-native apps

I am trying to configure firebase for my react native app. I get the following error:

Attempted import error: '@firebase/app' does not contain a default export (imported as 'firebase').

I am using firebase SDK 8.2.3 and the following code to configure firebase in my app:

import firebase from 'firebase';
import '@firebase/auth';
import '@firebase/firestore';

const firebaseConfig = {
    ...
  };


if (!firebase.apps.length) {
  firebase.initializeApp(firebaseConfig);
}

export { firebase };

Upvotes: 1

Views: 97

Answers (2)

Bhrugu Tundeliya
Bhrugu Tundeliya

Reputation: 160

bro just use this package

[https://rnfirebase.io/]

it is efficient and easy to use with all the use-case examples

Upvotes: 1

Vijay Kumawat
Vijay Kumawat

Reputation: 963

You have to import firebase as below

import firebase from "firebase/app" 

Upvotes: 0

Related Questions