에러
[RTK] Redux Toolkit 사용할 때 state값 proxy로 나올 때 해결법
박헹구
2022. 5. 29. 21:55
반응형
RTK를 사용할 때 state값이 proxy로 나온다면
import { createSlice, current } from "@reduxjs/toolkit";
...
console.log(current(state.data));
current를 붙여서 확인하면 데이터가 제대로 나온다.
Redux Toolkit: state showing as Proxy / undefined within reducer
Solved it, thanks! - For anyone interested, I was trying to access state.tasks.data within the reducer however due to scope, I could access it via state.data as I was already within the tasks slice.
stackoverflow.com
반응형