Created
October 23, 2021 09:16
-
-
Save jeremytrips/8cc29f7611fa34bc3cd9f7fd1157f1c0 to your computer and use it in GitHub Desktop.
Basic rnfirebase app that crashes when the using firestore emulator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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