Skip to content

Commit f87f86e

Browse files
committed
fix: unique한 key값으로 변경
1 parent fad6fc9 commit f87f86e

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/pages/MyPage/HistoryPage/TabPage/BookmarksPage/BookmarksPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { createRangeArray } from '@/utils/array';
1414
import { useQueryClient } from '@tanstack/react-query';
1515
import React, { useState } from 'react';
1616
import { bookmarksBtnContainer } from './BookmarksPage.style';
17+
import { v4 as uuidv4 } from 'uuid';
1718

1819
const BookmarksPage = () => {
1920
const [selectedPage, setSelectedPage] = useState(1);
@@ -63,7 +64,7 @@ const BookmarksPage = () => {
6364
return (
6465
<ItemMyBookmarksPosts
6566
id={item.postId.toString()}
66-
key={item.postId}
67+
key={uuidv4()}
6768
item={item}
6869
isChecked={checkItems.includes(item.postId.toString())}
6970
handleChecked={handleSingleChecked}

src/pages/MyPage/HistoryPage/TabPage/CommentsPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { MyCommentsPostsContentType } from '@/types/mypage';
99
import { createRangeArray } from '@/utils/array';
1010
import { useQueryClient } from '@tanstack/react-query';
1111
import React, { useState } from 'react';
12+
import { v4 as uuidv4 } from 'uuid';
1213

1314
const CommentsPage = () => {
1415
const [selectedPage, setSelectedPage] = useState(1);
@@ -34,7 +35,7 @@ const CommentsPage = () => {
3435
return (
3536
<ItemMyCommentsPosts
3637
id={item.postId.toString()}
37-
key={item.postId}
38+
key={uuidv4()}
3839
item={item}
3940
/>
4041
);

src/pages/MyPage/HistoryPage/TabPage/PostsPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { MyPostsContentType } from '@/types/mypage';
99
import { createRangeArray } from '@/utils/array';
1010
import { useQueryClient } from '@tanstack/react-query';
1111
import React, { useState } from 'react';
12+
import { v4 as uuidv4 } from 'uuid';
1213

1314
const PostsPage = () => {
1415
const [selectedPage, setSelectedPage] = useState(1);
@@ -32,7 +33,7 @@ const PostsPage = () => {
3233
return (
3334
<ItemMyPosts
3435
id={item.postId.toString()}
35-
key={item.postId}
36+
key={uuidv4()}
3637
item={item}
3738
/>
3839
);

src/pages/MyPage/HistoryPage/TabPage/VotedPostsPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { MyVotedPostsContentType } from '@/types/mypage';
99
import { createRangeArray } from '@/utils/array';
1010
import { useQueryClient } from '@tanstack/react-query';
1111
import React, { useState } from 'react';
12+
import { v4 as uuidv4 } from 'uuid';
1213

1314
const VotedPostsPage = () => {
1415
const [selectedPage, setSelectedPage] = useState(1);
@@ -32,7 +33,7 @@ const VotedPostsPage = () => {
3233
return (
3334
<ItemMyVotedPosts
3435
id={item.postId.toString()}
35-
key={item.postId}
36+
key={uuidv4()}
3637
item={item}
3738
/>
3839
);

0 commit comments

Comments
 (0)