Skip to content

Commit bc3da4f

Browse files
committed
chore: Userpage posts state 대신 user.post 사용하도록 수정
1 parent a44869d commit bc3da4f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/pages/UserPage/index.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const UserPage = () => {
2424
const { currentUser } = useUserContext();
2525
const [user, setUser] = useState(initialUserData.currentUser);
2626
const [userLevel, setUserLevel] = useState({});
27-
const [userPosts, setUserPosts] = useState([]);
2827
const [userLikePosts, setUserLikePosts] = useState([]);
2928

3029
const [currentTab, setCurrentTab] = useState(USER_POSTS);
@@ -39,7 +38,6 @@ const UserPage = () => {
3938
setUser(data);
4039
const { posts, comments, followers } = data;
4140
const { level } = getUserLevel({ posts, comments, followers });
42-
setUserPosts(posts);
4341
setUserLevel(level);
4442
}
4543
}, [pageUserId]);
@@ -76,7 +74,7 @@ const UserPage = () => {
7674
}}
7775
index={USER_POSTS}
7876
>
79-
<PostImageContainer posts={userPosts} />
77+
<PostImageContainer posts={user.posts} />
8078
</Tab.Item>
8179
<Tab.Item
8280
icon={{

0 commit comments

Comments
 (0)