[9주차/동동] 워크북 제출합니다.#90
Open
bukyung03 wants to merge 4 commits into
Open
Conversation
kcleverp
reviewed
May 30, 2026
| payload?: string; | ||
| } | ||
|
|
||
| function reducer(state: IState, action: IAction){ |
There was a problem hiding this comment.
useReducer 파트에서 전개 연산자 ...state를 활용해 불변성을 유지해야 하는 이유를 주석으로 정리해 두셔서 핵심이 잘 전달되는 좋은 예제 코드인것 같습니다.
한 가지 첨언 드릴 것이 있다면,
혹시 의도하신 기능인지는 모르겠지만 카드메이커 직무 변경 이후 타이핑한 텍스트가 남아있을 수 있을 것 같습니다 .
dispatch 성공 후 setDepartment('')를 호출해 입력창을 깔끔하게 비워주는 건 어떨까요?
입력된 데이터는 깔끔하게 정돈되어 보다 나은 UX를 제공할 수 있지 않을까요?
const handleApplyChange = () => {
dispatch({ type: 'CHANGE_DEPARTMENT', payload: department });
if (department === '카드메이커') {
setDepartment(''); // 성공 시 입력창 비우기
}
};
// 버튼의 onClick에 연결
<button onClick={handleApplyChange}> 직무 변경하기 </button>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트
📌 주안점