Skip to content

modular firestore DocumentSnapshot.exists is property not method contrary to docs #8460

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

Closed
mikehardy opened this issue Apr 8, 2025 · 1 comment · Fixed by #8483
Closed
Labels
impact: web-implementation An API in RNFB does not conform to the Firebase Web SDK Needs Attention plugin: firestore Firebase Cloud Firestore

Comments

@mikehardy
Copy link
Collaborator

  1. In Firebase docs regarding the migration to the modular API, we get this:

The modular API introduces a breaking change in which the property firestore.DocumentSnapshot.exists has been changed to a method.

I did not run into this method during the migration. Types and code seem to still be working as if it is a property.

const unsubscribe = onSnapshot(docRef, (docSnapshot) => {
  if (docSnapshot.exists) {} // I was able to keep this
  console.log(typeof docSnapshot.exists); // Logs boolean
});

Originally posted by @cbdeveloper in #8282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: web-implementation An API in RNFB does not conform to the Firebase Web SDK Needs Attention plugin: firestore Firebase Cloud Firestore
Projects
None yet
2 participants
@mikehardy and others