Skip to content

김세현 11주차 react 과제 제출합니다#85

Open
sehyeon7 wants to merge 3 commits intosnulion11th-seminar:sehyeonfrom
sehyeon7:sehyeon
Open

김세현 11주차 react 과제 제출합니다#85
sehyeon7 wants to merge 3 commits intosnulion11th-seminar:sehyeonfrom
sehyeon7:sehyeon

Conversation

@sehyeon7
Copy link

김세현 11주차 react 과제 제출합니다

@sehyeon7 sehyeon7 requested a review from whwoohw May 30, 2023 14:18
Copy link

@whwoohw whwoohw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생했어용! 간단하게 수정할만한 내용들 코멘트로 남겨놨습니다.
수정하시면 merge까지 해주세욥!!

major: "",
});

const [originalData, setOriginalData] = useState({});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

꼭 필요하지는 않지만 originalData도 미리 안에 프로퍼티들을 정의해줘도 좋을것같아욥

});

const [postList, setPostList] = useState([]);
const [id, setId] = useState("");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id는 number기 때문에 초기값을 "" 로 설정하는건 좀 이상하겠죠?
typescript를 쓰다보면 더 익숙해질거예요!


const [postList, setPostList] = useState([]);
const [id, setId] = useState("");
const [tags, setTags] = useState([]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag는 딱히 필요 없는 변수로 보여요!

Comment on lines +34 to +41
const getTagsAPI = async () => {
const tags = await getTags();
const tagContents = tags.map((tag) => {
return tag.content;
});
setTags(tagContents);
};
getTagsAPI();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag를 불러올 필요가 없어 보여요!

Comment on lines +99 to +101
onClick={() => {
handleCancelEdit("email");
}}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사실 button id를 email과 같은 type으로 설정하면, 모든 취소하기를 한 개의 function으로 처리할 수 있을 것 같아요!


<button
className="button flex-shrink-0 ml-2"
onClick={() => setIsEdit({ ...isEdit, email: true })}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분도 button id를 email로 처리하면 더 편할 것 같아요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants