Last active
March 29, 2021 13:24
-
-
Save zackbraksa/a35bfd794bc36ea1188f1e9f6dc50314 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// src/App.js | |
import React from 'react'; | |
import { db } from './firebase'; | |
function App() { | |
const [data, setData] = React.useState(); | |
React.useEffect(() => { | |
db.doc('people/me') | |
.get() | |
.then((data) => setData(data.data())); | |
}, []); | |
return <p>{data?.hungry ? "I'm hungry" : "I'm full"}!</p>; | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment