import storage from "redux-persist/lib/storage";
import createWebStorage from "redux-persist/lib/storage/createWebStorage";
const createNoopStorage = () => {
return {
getItem(_key) {
return Promise.resolve(null);
},
setItem(_key, value) {
return Promise.resolve(value);
},
removeItem(_key) {
return Promise.resolve();
},
};
};
const storage =
typeof window !== "undefined"
? createWebStorage("local")
: createNoopStorage();
https://www.youtube.com/watch?v=fjPIJZ1Eokg
참고
https://www.youtube.com/watch?v=fjPIJZ1Eokg
https://mightycoders.xyz/redux-persist-failed-to-create-sync-storage-falling-back-to-noop-storage