Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

273
Vistas
Understanding React Rendering

It seems that React components always run their render method when their parent component renders, even if no state or props changed for the child component, even if the child component has no state or props.

Is this supposed to be? Is there any inefficiency in this? Switching the child component to a PureComponent fixes this, and the child component will not reRender. Should I favor PureComponents over regular Components?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If you are wanting to control what makes a component rerender then you should be using shouldComponentUpdate which can be used on all react components unless they are stateless functional components. The PureComponent basically uses a shouldComponentUpdate automatically and does a shallow check on past and current props/state and if there was a change it will rerender.

Sometimes you might be dealing with more complex data structures and want to be in control of the shouldComponentUpdate yourself, in that case just follow the life cycle method instructions here.

https://facebook.github.io/react/docs/react-component.html#shouldcomponentupdate

Here is also the info for PureComponent

https://facebook.github.io/react/docs/react-api.html#react.purecomponent

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda