Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

220
Visualizações
How to get current index of snapped item in flatlist after it has stopped?

How do I get the current index of item at which the flatlist has stopped scrolling at and has snapped to?

const Scrollref=useRef();

<FlatList
    data={Data}
    ref={Scrollref}
    renderItem={...}
    keyExtractor={...}
    getItemLayout={...}
    initialScrollIndex={initialScrollIndex}
    initialNumToRender={3}
    snapToOffsets={Data.map((x, i) => (i*ITEM_HEIGHT))}
/>

I used this solution and although it does give the key index from viewableItems, it returns so on everytime the view is changed which seems very inefficient

is there anyway to get the key after the scrolling has stopped? maybe using onMomentumScrollEnd?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda