Skip to content

Instantly share code, notes, and snippets.

@indreklasn
Last active October 17, 2021 21:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indreklasn/b963b189319c394a555f8f8eb5b2fc39 to your computer and use it in GitHub Desktop.
Save indreklasn/b963b189319c394a555f8f8eb5b2fc39 to your computer and use it in GitHub Desktop.
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