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

243
Vistas
How to do it some items or headers should not render multiple time in react native

I have Table on right side there is columns on the top each box there is heading so . I just Want that. that heading should not repeat. on each box . it should only repeat on the top of the column.

here is code - https://snack.expo.dev/@xeteke8423/sellerformat

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

0

You can solve that by passing the index prop to the SecondaryBox and render the heading conditionally.

Make following changes in your codebase:

App.js:

//.......
              <View>
                {sample.map((item) => (
                  <View style={{ flexDirection: 'row' }}>
                    {item['sellerId']?.map((buyer, index) => (
                      <SecondaryBox sellerId={buyer} index={index} />
                    ))}
                  </View>
                ))}
              </View>
//.......

And in your SecondaryBox.js render the heading conditionally like below:

//............
<ScrollView horizontal>
          {
            <View style={{ flexDirection: 'row' }}>
              <View style={{ marginLeft: 10 }}>
                {index === 0 ? (
                  <View style={{position: ""}}>
                    <Text>Seller Profile</Text>
                    <Text>View Remark</Text>
                    <Text>Unit/Price</Text>
                  </View>
                ) : (
                  <View style={{ height: 55 }}></View>
                )}
//............

Here is the output:

enter image description here

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