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

245
Visualizações
React Native FlatList inside ScrollView causes Lag

So I have a screen that users can use to populate an array, which then is passed into a FlatList then uses said array for its data key, and I want these FlatList items to appear vertically, and with each new item added, it will expand the container that it is in, stacking each item on top of one another.

EXAMPLE: DoorDash; say you're on a restaurant's page and you're able to scroll up and down throughout it as it displays each menu item vertically.

What I attempted to implement was a FlatList inside of a ScrollView with scrollEnabled set to false on said FlatList, however, this causes immense lag within the emulator when I populate the data array for the FlatList, as well as the ScrollView jumping up and down when you reach the bottom of the page.

const [items, setItems] = React.useState([])
const [newItem, setNewItem] = React.useState(newItem)

const newItem = [
{
    name: null,
    about: null,
    picture: null,
    price: null
}]

<ScrollView>
    <SafeAreaView>
        <FlatList
            data={items}
            keyExtractor{(item, index) => index.toString()}
            scrollEnabled={false}
            renderItem={renderItems()}
        />
    </SafeAreaView>
</ScrollView>

As you can see, the user will end up manipulating newItem when adding a new item into the FlatList, which works perfectly fine, it just begins to lag the application after the ScollView begins to expand downward.

Thanks for the assistance, and I can provide more clarification if needed.

EDIT: For reference, this is what the FlatList items look like when rendered:

enter image description here

So I'm essentially looking for a method to be able to lazy load dynamic array objects in a flatlist that is simultaneously in a ScrollView without lagging, is it possible?

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