Skip to content

Commit

Permalink
chore:format
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Feb 7, 2025
1 parent 92e1332 commit 317f2d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ next: /migrating-to-v22

> React Native Firebase has begun to deprecate the namespaced API (i.e firebase-js-sdk `< v9` chaining API). React Native Firebase will be moving to the modular API (i.e. firebase-js-sdk `>= v9`) in the next major release. See [migration guide](/migrating-to-v22) for more information.

React Native Firebase is the officially recommended collection of packages that brings React Native support for all Firebase services on both Android and iOS apps.

React Native Firebase fully supports React Native apps built using [React Native CLI](https://reactnative.dev/docs/environment-setup?guide=native) or using [Expo](https://docs.expo.dev/).
Expand Down
16 changes: 8 additions & 8 deletions docs/migrating-to-v22.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ globalThis.RNFB_SILENCE_V8_DEPRECATION_WARNINGS = true;

# Migrating to React Native modular API

React Native Firebase does not currently have documentation for modular API. A refresh of the React Native Firebase documentation is something we will be aiming to achieve in the near future. We're keen to move the project to TypeScript which will then allow us to generate reference documentation from those types.
React Native Firebase does not currently have documentation for modular API. A refresh of the React Native Firebase documentation is something we will be aiming to achieve in the near future. We're keen to move the project to TypeScript which will then allow us to generate reference documentation from those types.

However, if you are familiar with the Firebase JS SDK, it will be a much smoother process. React Native Firebase is using the same API as can be found on the official [Firebase JS SDK modular API documentation](https://firebase.google.com/docs/reference/js).

Expand All @@ -30,10 +30,10 @@ import firestore from '@react-native-firebase/firestore';

const db = firestore();

const querySnapshot = await db.collection("cities").where("capital", "==", true).get();
const querySnapshot = await db.collection('cities').where('capital', '==', true).get();

querySnapshot.forEach((doc) => {
console.log(doc.id, " => ", doc.data());
querySnapshot.forEach(doc => {
console.log(doc.id, ' => ', doc.data());
});
```

Expand All @@ -42,16 +42,16 @@ querySnapshot.forEach((doc) => {
This is how the same query would look using the new, React Native Firebase modular API:

```js
import { collection, query, where, getDocs, getFirestore } from "@react-native-firebase/firestore";
import { collection, query, where, getDocs, getFirestore } from '@react-native-firebase/firestore';

const db = getFirestore();

const q = query(collection(db, "cities"), where("capital", "==", true));
const q = query(collection(db, 'cities'), where('capital', '==', true));

const querySnapshot = await getDocs(q);

querySnapshot.forEach((doc) => {
console.log(doc.id, " => ", doc.data());
querySnapshot.forEach(doc => {
console.log(doc.id, ' => ', doc.data());
});
```

Expand Down

0 comments on commit 317f2d3

Please sign in to comment.