Created
December 6, 2019 14:48
-
-
Save indreklasn/e9e8fd01cffe62c9277bb96a50c08d38 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
import React, { useEffect, useState } from 'react'; | |
import getAllProducts from './fauna/get-all-products.js' | |
function App() { | |
const [data, setData] = useState('') | |
useEffect(() => { | |
getAllProducts.then(data => setData(data)) | |
}, []) | |
return ( | |
<div className="App"> | |
<pre> | |
{JSON.stringify(data, null, 1 )} | |
</pre> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment