728x90
Uncaught Invariant Violation: defaultState for reducer handling [object Object] should be defined
에러!!
redux-actions로 리듀서를 작성하는 도중 발생 reducer를 여러개 사용할 경우 handleAction → handleActions로 변경하여 사용해야한다.
// 수정 전
import { handleAction } from "redux-actions"
const reducer = handleAction({
[INITIALIZE]: (state)=>initialState,
},initailState)
// 수정 후
import { handleActions } from "redux-actions"
const reducer = handleActions({
[INITIALIZE]: (state)=>initialState,
},initailState)
위 코드처럼 변경해주면 해결됩니당~
'error | tip > error' 카테고리의 다른 글
구글 소셜 로그인 (구글 로그인) - 에러편 (0) | 2022.11.09 |
---|---|
read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it! (0) | 2022.10.26 |
firebase init 401 error (0) | 2022.09.21 |
npx create-react-app 에러 (0) | 2022.09.21 |
nodejs module 에러 (0) | 2022.09.19 |