【发布时间】:2021-12-11 15:19:13
【问题描述】:
import Post from "./Post"
const PostList = ({posts}) => {
const postComponents = posts.map(post => {
return (
<Post
id = {post.id}
hub_id={post.hub_id}
post_body={post.post_body}
/>
)})
return(
<div className="postList">
{postComponents}
<p>hello world: postList</p>
</div>
)
}
export default PostList;
【问题讨论】:
-
这是我的主页.js
-
您如何使用
PostList?看起来posts为空。
标签: reactjs dictionary