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

148
Visualizações
Does change in Props Data Change the state of components or will it render the change?

I am currently learning React js, and the differences between props and States are apparent.

But will the change in data passed in the prop cause the component to re-render or will it still be static with the data passed initially?

I still have reservations on props values changes, if it does cause a re-render of the component(not changing the data within the components)?

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

0

A change in props will cause a re-render.

If you do not want this you can use a state like this:

const Component = (props) => {
  const [firstRenderProps] = useState(props);

firstRenderProps will always have the same value after a re-render

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