-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript not working on firebase.
unless used as firebase.app().
#774
Comments
@iljadaderko does this happen on the other modules as well? |
@Ehesp indeed it does, judging by typescript suggestions a lot is missing, see screenshots for both |
@pheromonez do you mind taking a look at this issue? |
@Ehesp No problem, I'll submit a PR once I've got something ready |
Awesome thanks very much! |
What works for me is to first instantiate a firebase object (for example in an injection container like TSDI) |
@danielw93 That did the trick for me, but docs show implementation that is more concise with web sdk: https://rnfirebase.io/docs/v3.2.x/installation/javascript in my opinion this is more friendly to web devs coming into react-native-firebase. |
import firebase from 'react-native-firebase';
const firebase2 = require('react-native-firebase');
// ...
firebase.app().auth().signInAnonymously().then(user => {
const docRef = firebase2.default.firestore().collection('users').doc(user.uid);
// ...
}); @pheromonez let me know if there’s anything I can do to help with fixing type definitions. I dug around a bit to see if I could find a flow to |
@meyer there's currently a PR for Firestore |
@Ehesp I've submitted a PR to improve the TS definitions. While going through the JS code I noticed that there's a @meyer Thanks for the offer to help. This fix was fairly small, so I've been able to complete it, but there are a couple of modules that currently don't have any TS definitions (admob, config, perf) and could certainly use some attention. |
@pheromonez yeah the |
Closing in favour of #788 |
This may not be the right place, but I'm wondering what the rationale for returning multiple values was? For Javascript it doesn't seem to matter, but for Typescript I've had to structure my code differently in comparison to if I was just using that standard Firebase.firestore SDK. |
Issue
I was using
firebase.app().auth
previously until discovering thatapp()
bit is no longer needed. Switching tofirebase.auth
causes typescript error below (not only for auth, but in general)Environment
The text was updated successfully, but these errors were encountered: