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) => { const onPageChange = (page:number) => {
setCurrentPage(page) setCurrentPage(page)
} }
return ( return (
<section> <section>
<div className={s.wrapper}> <div className={s.wrapper}>
<div className={s.list}> <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( return(
<div className={s.card}> <div className={s.card} key={`${product.title}-${index}`}>
<CardBlog {...product} key={index}/> <CardBlog {...product} />
</div> </div>
) )
}) })