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

129
Vistas
Getting an undefined error in react native while using react-native-draggable-flatlist

I am trying to create a draggable to do list using react-native-draggable-flatlist module. But I am getting a this error:

TypeError: undefined is not a function, js engine: hermes

This is my code:

  const Todos = () => {
  const [unfinishedTodos, setUnfinishedTodos] = useState([]);
  const [loading, setLoading] = useState(true)
  function loadData() {
    firestore()
      .collection('todos')
      .orderBy('priority', 'desc')
      .get()
      .then(snap => {
        setLoading(true);
        let unfinished = [];
        snap.docs.map(each => {
          let eachdict = {
            id: each.id,
            taskName: each.get('taskName'),
            taskDesc: each.get('taskDesc'),
            priority: each.get('priority'),
            finished: each.get('finished'),
            time: each.get('time'),
            index: each.get('index'),
            timeType: each.get('timeType'),
          };
            unfinished.push(eachdict);
        });
        setUnfinishedTodos(
          unfinished.sort((a, b) => {
            return a.index - b.index;
          }),
        );
        setLoading(false);
      })
      .catch(error => {
        console.log(error.message);
      });
  }
           

 return( 
      <DraggableFlatList data={unfinishedTodos} renderItem={({item, index, drag, isActive}) => {
   return (
      <Text>{item.taskName}</Text>
)}}                     
    keyExtractor={(item, index) => `${item.id}`}
    onDragEnd={({data}) => console.log(data)} />
   )}

What am I doing wrong or which part of the code has to be replaced?

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

0

There is no setLoading? Maybe it's just that.

const [loading, setLoading] = useState(true);
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