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

148
Vistas
Change from ScrollView to FlatList in react native

I'm going to make a todolist app. On the main page, to show the task of todolist, I used scrollview, but I want to change it to FlatList.

<ScrollView width = {width-20}>
            {Object.values(tasks).map(item => (
               <Task key = {item.id} item={item} deleteTask={_deleteTask} 
               toggleTask={_toggleTask} updateTask={_updateTask}/>
           ))} 
         </ScrollView>

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

0

To Flatlist
More info here

<FlatList
     data={Object.values(tasks)}
     keyExtractor={(item)=>item?.id}
     renderItem={({item})=><Task key = {item.id} item={item} deleteTask={_deleteTask} toggleTask={_toggleTask} updateTask={_updateTask}/>}
     />
about 4 years ago · Juan Pablo Isaza Denunciar

0

Because of performance, I recommend using the variation when we avoid inline functions. If you want to know more how to optimize React native FlatList performance: https://codingislove.com/optimize-react-native-flatlist-performance/

const renderItem = ({item})=><Task item={item} deleteTask={_deleteTask} toggleTask={_toggleTask} updateTask={_updateTask}/>;
const keyExtractor = (item) => item.id;

return (
  <Flatlist
   data={Object.values(tasks)}
   renderItem={renderItem}
   keyExtractor={keyExtractor}
  />
);
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