FirebaseExtended / FirebaseExtended/reactfire
Enable direct ad-hoc imports
- Langage dominant
- TypeScript
- Étoiles
- 3.6k
- Forks
- 403
- Merge moyen
- 14 h 53 min
- PR mergées (30 j)
- 5
Description
`Can't find variable: IDBIndex` when setting up on Expo
I used the same hierarchy I had working on the web. I am not using performance or analytics, so I think all of the underlying components should work.
But, I believe that since there isn't a way (that I can tell) to import only specific components, I end up with an error as if I were importing performance package.
```
import React from 'react'
import { getAuth, connectAuthEmulator } from 'firebase/auth'
import { getFunctions, connectFunctionsEmulator } from "firebase/functions"
import { getStorage, connectStorageEmulator } from "firebase/storage"
import { getFirestore, connectFirestoreEmulator } from "firebase/firestore";
import { FirebaseAppProvider, useFirebaseApp, AuthProvider, StorageProvider, FirestoreProvider } from 'reactfire';
function FirebaseComponents({ children }) {
const app = useFirebaseApp() // a parent component contains a `FirebaseAppProvider`
const auth = getAuth(app)
const functions = getFunctions(app)
const firestoreInstance = getFirestore(app)
const storage = getStorage(app)
return (
{children}
);
}
function AllFirebaseComponents({ children, fire }) {
return (
{children}
)
}
export default AllFirebaseComponents
```
### Version info
"react": "^17.0.2",
"react-native": "~0.63.4",
"reactfire": "^4.2.0",
"firebase": "^9.0.1",
### Test case
TBU, will try to get one of these
### Steps to reproduce
Start a new expo app, attempt to use reactfire. Get error mentioned above.
### Expected behavior
Be able to import only the components needed, ex:
```
import FirebaseAppProvider from 'reactfire/FirebaseAppProvider';
```
### Actual behavior
I get the error mentioned above which I think comes from the performance stuff
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par reproduire l’erreur IDBIndex dans une nouvelle application Expo en utilisant les versions indiquées de React Native, Reactfire et Firebase, puis examinez comment Reactfire exporte ses providers. C’est terminé lorsque les consommateurs peuvent importer uniquement le composant nécessaire, tel que FirebaseAppProvider, sans charger de fonctionnalité sans rapport ni déclencher l’erreur.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- firebase, react, react-native, typescript
- Domaine
- developer-experience, frontend, mobile
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100