refactor: add key BlogsList

This commit is contained in:
unknown 2021-09-08 19:50:38 +07:00
parent a58d30d528
commit e8f50beb14

View File

@ -131,15 +131,16 @@ const BlogsList = ({ data = BLOGSLIST_DATA }:BlogsListProps) => {
const onPageChange = (page:number) => {
setCurrentPage(page)
}
return (
<section>
<div className={s.wrapper}>
<div className={s.list}>
{
data.slice(currentPage*defaultBlogPageSize,(currentPage+1)*defaultBlogPageSize).map((product,index)=>{
data.slice(currentPage*defaultBlogPageSize,(currentPage+1)*defaultBlogPageSize).map((product,index)=> {
return(
<div className={s.card}>
<CardBlog {...product} key={index}/>
<div className={s.card} key={`${product.title}-${index}`}>
<CardBlog {...product} />
</div>
)
})