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

179
Vistas
React Native FlatList ignoring item spacing

I'm really struggling to figure out why i can't get my FlatList to render items the way that I would expect.

I'm using react-query in order to fetch a data array. I pass this array into my FlatList to be rendered, then I use a render function to render a list item. However my flat list completely ignores all of the item's padding and margin, sometimes.

Here's a snippet to better explain what I'm trying to do:

function Component() {
  data = [
    {a: true, otherStuff},
    {b: true, otherStuff}
  ]
  
  function renderItem({item, index}) {
    if (item.a) {
      return <ListItemA/>
    }
     if (item.b) {
       return <ListItemB/>
  }

render(
  <FlatList
    renderitem={renderItem}
    data={data}
  />
  )
}

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

0

if you will upload the components code, it will be more clear. try to use item separator and add spacing there https://reactnative.dev/docs/flatlist#itemseparatorcomponent a

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