Skip to content

Commit c2291a1

Browse files
authored
docs(firestore): update emulator example with useEmulator (#5692)
1 parent 90b4d70 commit c2291a1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/firestore/emulator.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ You need to configure the following property as soon as possible in the startup
3131
import '@react-native-firebase/app';
3232
import firestore from '@react-native-firebase/firestore';
3333

34-
const db = firestore();
35-
36-
// set the host property to connect to the emulator
34+
// set the host and the port property to connect to the emulator
3735
// set these before any read/write operations occur to ensure it doesn't affect your Cloud Firestore data!
38-
db.settings({ host: 'localhost:8080', ssl: false });
36+
if (__DEV__) {
37+
firestore().useEmulator('localhost', 8080);
38+
}
39+
40+
const db = firestore();
3941
```
4042
4143
# Clear locally stored emulator data

0 commit comments

Comments
 (0)