我正在呈现一个帖子列表.对于每一篇帖子,我都希望呈现一个带有帖子id的锚定标签,作为href字符串的一部分.
render: function(){
return (
<ul>
{
this.props.posts.map(function(post){
return <li key={post.id}><a href='/posts/'{post.id}>{post.title}</a></li>
})
}
</ul>
);
我该怎么做才能让每篇文章都有/posts/1
、/posts/2
等的href?