[#232] Modify: useMetionNotification에서 mentionList 의존성 제거 #235
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.
📝 작업 내용
EditorTextArea에 container-presentational 패턴 적용을 하려다보니 문제가 발생했습니다.
onSubmit시 멘션리스트도 같이 보내야 하는데 기존의 멘션 리스트는 EditorTextArea.tsx내의 훅에서 props로 보내주기 때문에 가능했습니다.
하지만 패턴을 적용할 코드에서는 EditorTextArea.tsx 외부에서 onSubmit을 주입하기 때문에 props로 받을 수 없고
커스텀 훅의 Props로 mentionList를 받다보니 선언하는 시점에 mentionList가 없으면 쓸 수 없게되는 의존성이 생겼기 때문에 문제가 발생한 것입니다.
이를 mentionNotification 함수의 props로 변경해서 커스텀 훅의 의존성을 제거하였습니다.
그리고 기존에 타입가드로 분기처리를 해주던 useEditorLogicByProps.ts는 패턴 적용 후 사라질 훅 입니다!
💬 리뷰 요구사항
편하게 말씀해주세요!
close #232