Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import Post from "./Post"
- import './PostList_style.css'
- function PostList(props) {
- const post_list = [
- {
- "id": 1,
- "title": "Updated title 2",
- "body": "updated body 2",
- "created": "2020-04-10T16:36:14.692884Z"
- },
- {
- "id": 2,
- "title": "Second",
- "body": "Second post",
- "created": "2020-04-10T16:36:22.244885Z"
- },
- {
- "id": 3,
- "title": "Third",
- "body": "Third post",
- "created": "2020-04-10T16:36:31.386342Z"
- },
- {
- "id": 4,
- "title": "My latest post",
- "body": "Hello there!",
- "created": "2020-04-11T08:50:59.641843Z"
- }
- ];
- return (
- <div className="post_list_layout">
- {post_list.map(post_data => <Post key={post_data.id} data={post_data}/>)}
- </div>
- );
- }
- export default PostList;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement