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

383
Visualizações
Error: Maximum update depth exceeded. React limits the number of nested updates to prevent infinite loops

Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

I have made a component in react JS which is returning the color name. I just want to store that color name in my parent component , so how can I do this ?

here is my code line which is creating error :

{this.setState({navColor: <ChangeNavColor stage={this.state.Stage}/>})}

or is there any another way that I can store this component return value in a variable and that variable I will assign to this "navColor" state ?

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

0

you need to call function :

{()=>this.setState({navColor: <ChangeNavColor stage={this.state.Stage}/>})}
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