[🐛] Modular API discrepancies from firebase-js-sdk #7967
Labels
Keep Open
avoids the stale bot
platform: javascript
plugin: firestore
Firebase Cloud Firestore
type: breaking change
Issue
Observed some modular API discrepancies between
react-native-firebase
andfirebase-js-sdk
.For example, DocumentSnapshot::exists() is declared as a function in
firebase-js-sdk
while it is defined as a boolean value inreact-native-firebase
. There are some similar cases but unfortunately I am not able to identify all of them.This issue bothered me because I want to write platform-specific codes with
firebase-js-sdk
andreact-native-firebase
.Say I have two wrapper files named
firebase.native.ts
(importreact-native-firebase
) andfirebase.web.ts
(importfirebase-js-sdk
), then I have another file namedtest-api.ts
which imports either firebase sdk based on platform. In this file, it tries to read from Firestore and want to check if snapshot exists. I expect the usage likesnapshot.exists()
can work for both native and js environment while currently it cannot.Kindly ask if someone can help fix them? Thank you so much!
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: