Closed knevagi closed 3 years ago
I had the same error in my React Native app. Try call initFirestorter
(and maybe firebase.initializeApp
?) before class declaration. I think the problem is calling it in componentWillMount method.
...
import {initFirestorter, Collection} from 'firestorter';
const config = {
apiKey: 'AIzaSyDyF8h7SYE3iiYxt-ZAmdXxWu9Pd6cuvxo',
authDomain: 'manager-31000.firebaseapp.com',
databaseURL: 'https://manager-31000.firebaseio.com',
projectId: 'manager-31000',
storageBucket: 'manager-31000.appspot.com',
messagingSenderId: '1079074827203'
};
if (!firebase.apps.length) {
firebase.initializeApp(config);
}
initFirestorter({firebase:firebase});
class App extends Component {
...
The problem is when you export constants that are documents and/or collections from store files.
These often get initialized before firestorter does, causing all sorts of odd issues.
The problem is when you export constants that are documents and/or collections from store files.
These often get initialized before firestorter does, causing all sorts of odd issues.
Thanks for the tip, I started using dinamyc imports in my index app files to avoid this issue. Now I just import my components after my app have finished initFirestore.
I am new to using firestorter and I am getting the error that firestorter cannot get firestore while building react native app. Any help would be appreciated. I have only tried to follow the documentation on npmjs Thank you.
TheatreList.js
App.js