Created
September 1, 2019 08:58
-
-
Save Eth3rnit3/66bb0ce21f299c387abfb57916292323 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 from 'react'; | |
import './App.css'; | |
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> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment