Skip to content

Instantly share code, notes, and snippets.

@DZuz14
Created July 21, 2021 12:51
Show Gist options
  • Save DZuz14/90545cbbb05642ffa38c9ad6da6faf69 to your computer and use it in GitHub Desktop.
Save DZuz14/90545cbbb05642ffa38c9ad6da6faf69 to your computer and use it in GitHub Desktop.
Tornado Chart App Skeleton
import React, {
useEffect,
useState
} from "https://cdn.skypack.dev/[email protected]";
import ReactDOM from "https://cdn.skypack.dev/[email protected]";
import axios from "https://cdn.skypack.dev/[email protected]";
const App = () => {
const [stats, setStats] = useState([]);
const fetchStats = async () => {
const res = await axios.get("https://tinyurl.com/2pa553ap");
setStats(res.data);
};
useEffect(() => {
fetchStats();
}, []);
return <div></div>;
};
ReactDOM.render(<App />, document.querySelector(".app"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment