n6g7 / redux-saga-firebase

A redux saga integration for firebase.
https://redux-saga-firebase.js.org/
MIT License
284 stars 57 forks source link

How do integrate redux-sage-firebase with react-native-firebase #190

Open zzbynzz opened 5 years ago

zzbynzz commented 5 years ago

I integrated using code: `import firebase from 'react-native-firebase'; import ReduxSagaFirebase from 'redux-saga-firebase';

const reduxSagaFirebase = new ReduxSagaFirebase(firebase.app);

export default reduxSagaFirebase;` But still receive error (I need use Firestore) :

Screen Shot 2019-05-07 at 16 14 11
zzbynzz commented 5 years ago

I installed package : @firebase/firestore , but it still notify error : error: bundling failed: Error: Unable to resolve module@firebase/appfrom/Users/quan_tb/workspaces/pharmedia/mobile/node_modules/@firebase/firestore/dist/index.cjs.js: Module@firebase/appdoes not exist in the Haste module map Seems @firebase/firestore can't work with react-native-firebase, as it says : This package is not intended for direct usage, and should only be used via the officially supported firebase package.

quantb95 commented 5 years ago

No one care :'(

Matgsan commented 4 years ago

@zzbynzz Have you solved? I am having the same issue.

david-potgieter commented 4 years ago

Should anyone else stumble accross the same issue:

The documentation is not very clear (on react-native-firebase) but you should import the firebase tool you intend to use for the saga. As example:

import firebase from '@react-native-firebase/app';
import ReduxSagaFirebase from 'redux-saga-firebase';
import '@react-native-firebase/auth'; // <--- import it here 
import '@react-native-firebase/firestore'; // <--- import it here 

const firebaseApp = firebase.apps[0];
const rsf = new ReduxSagaFirebase(firebaseApp);

export default rsf;

This was the clue: https://rnfirebase.io/app/usage#switching-app-instance