Skip to content

Instantly share code, notes, and snippets.

@jeremytrips
Created October 23, 2021 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremytrips/8cc29f7611fa34bc3cd9f7fd1157f1c0 to your computer and use it in GitHub Desktop.
Save jeremytrips/8cc29f7611fa34bc3cd9f7fd1157f1c0 to your computer and use it in GitHub Desktop.
Basic rnfirebase app that crashes when the using firestore emulator
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React, { useEffect } from 'react';
import {
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import firestore, { firebase } from '@react-native-firebase/firestore';
// firestore().settings({
// host: "http://localhost:5003"
// })
// firestore().useEmulator('http://localhost', 5003);
const db = firestore()
const App = () => {
const isDarkMode = useColorScheme() === 'dark';
useEffect(()=>{
db.collection("test").get()
.then(console.log)
}, [])
return (
<View>
<Text>
test
</Text>
</View>
)
};
const styles = StyleSheet.create({
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
},
highlight: {
fontWeight: '700',
},
});
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment