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

102
Vistas
Enum React multiple different child components

I have following functional component without any props with different children:

<Parent>
  <ChildA />
  <ChildB />
  ...
  <ChildG />
</Parent>

Is there any way to write all children in Parent component not manually, e.g. in loop like:

<Parent>
  {childrenArray.map(child => <Child>}
</Parent>

If yes, which way is correct?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Create an array of JSX elements

const childrenArray = [ChildA , ChildB, ChildC];

Render like this

<Parent>
  {childrenArray.map(Child => <Child />)}
</Parent>
about 4 years ago · Juan Pablo Isaza 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