import { useState, useEffect } from 'react'
const App = () => {
const [data, useData] = useState(null);
useEffect(() => {
const url = 'endpoint url';
fetch(url)
.then(res => res.json())
.then(data => setData(data))
};
return (
<div id='App'>
{ data && <p>data.id</p> }
</div>
);
};
export default App