Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
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 answers
Answer question

0

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

const [loading, setLoading] = useState(true);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!