- 참고 링크
Getting an error "A non-serializable value was detected in the state" when using redux toolkit - but NOT with normal redux
I am trying to switch an app I am building over to use Redux Toolkit, and have noticed this error coming up as soon as I switched over to configureStore from createStore: A non-serializable value ...
stackoverflow.com
Redux Toolkit - A non-serializable value was detected in an action, in the path: `type` 오류 해결
리덕스 강의 과제를 따라하다가 아래와 같은 오류와 직면했다. 오류 내용을 천천히 읽어 보면 action에 직렬화가 불가능한 값을 전달했다는 뜻으로 해석할 수 있다. 여기서 직렬화란 redux에서 값
guiyomi.tistory.com
export const store = configureStore({
reducer: {
locationReducer,
},
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({
serializableCheck: false,
}),
});
middleware를 추가해준다.
에러 원인
Redux Toolkit에서 자동으로 생성해 주는 action 객체는 action 생성자 함수 형태이기 때문이다. type의 인자로 string 값이 전달되어야 하는데 함수가 전달돼서 오류가 발생한 것이다.
'Frontend' 카테고리의 다른 글
[Framer motion] width (0) | 2023.10.18 |
---|---|
React-Query Query data cannot be undefined 해결 방법 및 Promise에 대해 (0) | 2023.07.04 |
Redux 와 RTK(Redux toolkit) (0) | 2023.06.26 |
unable to resolve dependency tree 해결 (0) | 2023.01.27 |
codelion react 정리 (0) | 2022.07.09 |