-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FE] 마이페이지 구매내역의 상세보기 isModal 변경 #228
Conversation
수고하셨습니다 hook부분이 인상적이네요 redux에서 usedispatch랑 useselector 을 가져오는걸 훅으로만들어서 가져올수있군요 저도 얼른 해서 올릴게요! |
import type { RootState, AppDispatch } from "./store"; | ||
|
||
export const useAppDispatch: () => AppDispatch = useDispatch; | ||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
내용 찾아봐도 잘 이해가 안가는데 참고하신 링크 알려주실수 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
내용 찾아봐도 잘 이해가 안가는데 참고하신 링크 알려주실수 있을까요?
타입지정을 위해 만들어진 hook 이고 참고링크는 따로 있지않고 chatGPT 사용해서 작성했어요 만약 저희가 사용하던대로 dispatch 와 selector를 사용하면 타입지정이 안돼서 오류가 나더라구요 이 타입들은 store에서 export해온 타입으로 사용중입니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그랬군요, redux-toolkit , React, TS 같이 사용하려면 설정해야 되는거구나 라고 생각해서 내용 찾아보니까 경민님이 설정하신거처럼 나오더라고요, 근데 이해가 잘 안되어서 여쭤봣었던거라! 더 공부해보겠습니다!!
|
||
const myOrderSlice = createSlice({ | ||
name: "myorder", | ||
initialState: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialState는 꼭 지정 안해줘도 되는군요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialState는 꼭 지정 안해줘도 되는군요?
아니요, initialState는 위에 선언되어 있어요. 타입지정을 위해서 위에 선언한걸 받아와서 썼습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 그렇네요! 삭제된 부분만 보고 위에는 자세히 안봣나봐요! 자세하게 보는 습관을 들여야겠어요!! ㅠㅠ
PR Checklist
PR이 다음 요구사항을 만족하는지 확인해주세요.
PR Type
어떤 종류의 PR인가요?
이슈와 연결하기
Issue Number: #227
무엇이 추가 되었나요?
기타 정보