[React] Redux-toolkit 같은 슬라이스의 리듀서 사용하기, 리듀서 콘솔 보이게 하기
리듀서 내부에서 같은 슬라이스의 다른 리듀서 사용하기 // 슬라이스명.caseReducers.리듀서명(인자) // state를 사용해야한다면 인자로 state를 전달해주어야 함 customSlice.caseReducers.updateInfo(custom, product, true); 리듀서 내부에서 콘솔 출력했는데 proxy로 나오는 경우, current로 감싸서 확인하기 import { current } from '@reduxjs/toolkit'; ... reducers: { updateInfo: (state, action) => { console.log(current('내용')) }, } * 참고 caseReducers current 2023.04.19
Javascript
2023. 4. 19. 14:59
공지사항