Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!