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

181
Visualizações
Handle Dark mode in Material UI redux

I have a React app with Material UI. The dark mode basically works, but anytime I try to change the dark mode state on a page where the page is rendered from redux state data, the whole page crashes. I assume because it loses the redux state:

Warning: Failed prop type: The prop `items` is marked as required in `WarehouseTable`, but its value is `null`.

Which is correct because the Theme wraps the whole App, so all children object re-render itself.

What I don't know is why the redux state is not preserved. Why it seems that the redux state is lost?

How can I handle this?

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

0

The problem for me was that the ReduxProvider and the ThemeProvider was rendered in the same function.

So I moved the ThemeProvider to a ReduxProvider child component and this solved my issue.

about 4 years ago · Juan Pablo Isaza Relatório

0

You can try by moving redux wrapper around the mui wrapper

 <ReduxProvider>
  <ThemeProvider>
   <App/>
  </ThemeProvider>
 </ReduxProvider>

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