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

113
Visualizações
Does change in each independent state in functional component triggers a render for the component in React?

When we have multiple independent states in a component then if I change any one of them, will it trigger a re-render of the entire component?

Initialise const [email, setEmail] = useState('') const [val, setVal] = useState(true)

Update setVal(false)

Will this render the whole component again?

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

0

Yes the Component will be rendered again. Let me add: Although if you have two states changing (almost) simultanously the state update will be batched. In React 18 React batches state updates in React events handlers, promises, setTimeout and native event handlers resulting in only one rerender.

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