Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

381
Visualizações
Is there a way to set the serializableCheck to false for one reducer only in redux?

Currently I have disabled the serializableCheck in my store.js and it works, however I'd prefer if I could only set it to false for one reducer in particular, and keep it set to true for all the rest.

export const store = configureStore({
        reducer: {
            app: appReducer,
            settings: settingsReducer,
            admin: adminReducer,
            popout: popoutReducer,
        },
        middleware: getDefaultMiddleware({
            serializableCheck: false,
        }),
    });

I'm aware disabling this check can cause issues in the future, I only have one reducer where I want this check to be disabled.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Per the docs at https://redux-toolkit.js.org/api/serializabilityMiddleware , you should be able to use the ignoredPaths option to provide a keypath string to ignore in the state:

configureStore({
  reducer: rootReducer,
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
    serializableCheck: {
      ignoredPaths: ['someSlice.nested.field']
    }
  })
})

That said, I'd still recommend finding ways to store serializable values in the state instead.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda