Skip to content

Question: How to use this with redux-persist? #121

Closed
@SeedyROM

Description

@SeedyROM

I've been experimenting with getting redux-persist to integrate with my current project that's using react-starter-kit but I'm already hitting some walls and obscure errors.

First issue is a middleware that doesn't seem to know how to handle the register call for the persist middleware (which is caused by serializable-state-invariant-middleware).

Second issue is that PersistGate never renders, I can only assume this is because rehydrate is never called? I'm not really sure what's going on there, it's probably by own fault.

If this isn't the place to ask I'm sorry, but using redux-persist seems like a very common use case.

Update 1:

I solved the serializable-state-invariant-middleware issue by simply adding thunk myself. (Note it needs to be manually installed!)

Here's my store.ts:

import logger from "redux-logger";
import { configureStore } from "redux-starter-kit";
import thunk from "redux-thunk";
import rootReducer from "./reducers";

const store = configureStore({
    reducer: rootReducer,
    middleware: [thunk, logger],
});

export default store;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions