prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

Integration with @react-native-firebase/app #1118

Closed perrin-lucas closed 2 years ago

perrin-lucas commented 2 years ago

I have installed react-native-firebase following this tutorial https://rnfirebase.io/

With the latest react-native-firebase version the dependencies are now like that after the installation

  "dependencies": {
    ...
    "@react-native-firebase/app": "^12.1.0",
    "@react-native-firebase/auth": "^12.1.0",
    "@react-native-firebase/firestore": "^12.1.0",
    ...
  },

The example https://github.com/prescottprue/react-redux-firebase/tree/master/examples/complete/react-native-firebase still using the V2, maybe need to be updated ?

The example on the website http://react-redux-firebase.com/docs/integrations/react-native.html#native-modules use the old importation method for react-redux-firebase and initialize the application without importing firebase 🤨?

import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import RNFirebase from 'react-native-firebase'; <-- OLD IMPORTATION METHOD
import { createStore, combineReducers, compose } from 'redux'
import { ReactReduxFirebaseProvider, firebaseReducer } from 'react-redux-firebase'
// import { createFirestoreInstance, firestoreReducer } from 'redux-firestore' // <- needed if using firestore

...

// Initialize firebase instance
firebase.initializeApp(fbConfig)

Does anyone know how to integrate correctly react-native ? I know this is not a real issue but maybe something to update in the documentation, thanks.

laurentS commented 2 years ago

@xlucxs I'm not a maintainer here, but I've recently upgrade our app, it's all open source, so feel free to take a look around if you need an example. This file should be helpful. And if that's not what you needed, sorry for the noise :sweat_smile:

perrin-lucas commented 2 years ago

@laurentS Thank you very much, this is exactly what I was looking for👍 !