9.04 Creating Http Request To Get Data
Blog.js
Blog.js
import axios from "axios";
import React, { Component } from "react";
import FullPost from "../../components/FullPost/FullPost";
import NewPost from "../../components/NewPost/NewPost";
import Post from "../../components/Post/Post";
import "./Blog.css";
class Blog extends Component {
componentDidMount() {
axios.get("https://jsonplaceholder.typicode.com/posts").then((response) => {
console.log(response);
});
}
render() {
return (
<div>
<section className="Posts">
<Post />
<Post />
<Post />
</section>
<section>
<FullPost />
</section>
<section>
<NewPost />
</section>
</div>
);
}
}
export default Blog;