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

149
Vistas
Is it memory intensive to store react components in an object?
{
    ui: <Component />,
}

What if an object stores hundreds of these components. Would this be memory intensive?

about 4 years ago · Santiago Gelvez
2 Respuestas
Responde la pregunta

0

It would be no more memory intensive than displaying them in the UI. Behind the scenes, React stores the components as objects, so there is no performance cost.

about 4 years ago · Santiago Gelvez Denunciar

0

The code <Component /> transpiles to React.createElement(Component, null);, which will return an object that looks roughly like this (dev builds may include extra properties to help with debugging):

{
  $$typeof: Symbol(react.element)
  key: null,
  props: {}
  ref: null,
  type: Component,
  _owner: null,
}

Of those, the props and the type are the only things that could conceivably have a significant memory footprint. But Component is very likely referenced somewhere else anyway, so i doubt it can be garbage collected whether you create this element or not.

In short, i'd say the memory is only a problem if both of the following are true: 1) the props are very large, and 2) the props would be garbage collected if not for this element.

about 4 years ago · Santiago Gelvez 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