Skip to content

Instantly share code, notes, and snippets.

@Eth3rnit3
Created September 4, 2019 21:47
Show Gist options
  • Save Eth3rnit3/3a4d4f2b499f4098765b60b2927ea0ae to your computer and use it in GitHub Desktop.
Save Eth3rnit3/3a4d4f2b499f4098765b60b2927ea0ae to your computer and use it in GitHub Desktop.
import React from 'react';
import './App.css';
import Uploader from './uploader';
const fetchTestDatas = function () {
fetch('/api/v1/tests')
.then(res => res.json())
.then((response) => { console.log("Test datas response", response); })
.catch((error) => { console.log("Error while fetching test datas", error); })
}
function App() {
return (
<div className="App">
<button onClick={fetchTestDatas}>
Fetch Test Datas
</button>
<Uploader />
</div>
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment