-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
34 lines (30 loc) · 861 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { useEffect, useState } from "react";
import axios from "axios";
import "./assets/mediumish.css";
import Cards from "./components/card";
function App() {
const [articleData, setArticleData] = useState([]);
useEffect(() => {
const fetchData = async () => {
const result = await axios(
"https://advanced-medium-api.herokuapp.com/advanced/customized/user/sabesan96"
);
setArticleData(result.data);
};
fetchData();
}, []);
console.log(articleData);
return (
<div className="container">
<section className="recent-posts">
<div className="container">
<div className="row g-5 listrecent">
{articleData.length !== 0 &&
articleData.map((data) => <Cards data={data} />)}
</div>
</div>
</section>
</div>
);
}
export default App;