Last active
October 17, 2021 21:47
-
-
Save indreklasn/b963b189319c394a555f8f8eb5b2fc39 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, Fragment } from "react"; | |
import Tabletop from "tabletop"; | |
import "./styles.css"; | |
export default function App() { | |
const [data, setData] = useState([]); | |
useEffect(() => { | |
Tabletop.init({ | |
key: "1TK1Qj6kfA90KbmFAdnIOtKUttpJUhZoZuOPy925c6nQ", | |
simpleSheet: true | |
}) | |
.then((data) => setData(data)) | |
.catch((err) => console.warn(err)); | |
}, []); | |
return ( | |
<> | |
<h1>data from google sheets</h1> | |
<ul> | |
{data.map((item, i) => ( | |
<Fragment key={i}> | |
<li>URL -- {item.URL}</li> | |
<li>Email - {item.email}</li> | |
<li>Token - {item.token}</li> | |
<br /> | |
</Fragment> | |
))} | |
</ul> | |
</> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment