Redux – handling really large state object

I’ll elaborate on the excellent answer by @phry.

Instead of configuring the ignored paths, you could just increase the timeouts:

const store = configureStore({
  // ...
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
    immutableCheck: { warnAfter: 128 },
    serializableCheck: { warnAfter: 128 },
  })
})

or turn off the checks altogether:

const store = configureStore({
  // ...
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
    immutableCheck: false,
    serializableCheck: false,
  })
})

Source: https://redux-toolkit.js.org/api/serializabilityMiddleware

Leave a Comment

tech