일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- context
- background: url
- react
- react hook
- React API 참고서
- React 고급 안내서
- React 고급안내서
- Programmers
- Render Props
- hook
- Nextjs
- React 18 Nextjs
- Babel
- background tab
- getUTCDate
- Nextjs React 18
- background setttimeout
- background setInterval
- CSS
- Javascript
- React 공식문서
- react-helmet
- notFound()
- React 18
- React18
- next13 head
- codingtest
- 고급안내서
- RTK Query
- Next13
Archives
- Today
- Total
akjfal
11/12 본문
redux startr kit + redux persist + redux saga
import { combineReducers } from "redux"
import { persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import root from './reducer'
const persistConfig = {
key:'root',
storage,
whitelist: ['state']
}
export default combineReducers({
root: persistReducer(persistConfig, root),
})
import React from "react";
import { configureStore, getDefaultMiddleware } from 'redux-starter-kit'
import { persistStore } from 'redux-persist'
import { Provider } from "react-redux";
import createSagaMiddleware from "redux-saga";
import { PersistGate } from 'redux-persist/integration/react'
import rootReducer from "./reducers";
import rootSaga from "./sagas";
const sagaMiddleware = createSagaMiddleware();
const store = configureStore({
reducer: rootReducer,
middleware: [ sagaMiddleware ]
});
sagaMiddleware.run(rootSaga);
const persistor = persistStore(store);
const ProviderWrapper = ({ children }) => {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
{children}
</PersistGate>
</Provider>
)
};
export default ProviderWrapper
non-serializable value error
https://github.com/rt2zz/redux-persist/issues/988
non-serializable value error · Issue #988 · rt2zz/redux-persist
Hi folks 👋, I just installed the redux-persist in a project still in its early stages and I'm facing this error message in the console as first thing when the page loads. I haven't done muc...
github.com
redux-starter-kit과 같이 사용시 발생
해결 방법 :
const store = configureStore({
reducer: rootReducer,
middleware: [...getDefaultMiddleware(), sagaMiddleware ]
});
이 코드를
const store = configureStore({
reducer: rootReducer,
middleware: [ sagaMiddleware ]
});
이렇게 코치기 ...getDefaultMiddleware() 삭제
Comments