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

287
Views
How to display data from Firestore? (React)

How can I put the data from firestore into my html?

Im making a ToDo list app project and this is my function for making tasks:

const Task = async (name, desc, dueDate) => {
    return await setDoc(doc(db, "projects", name), {
        name,
        id: crypto.randomUUID(),
        desc,
        dueDate,
        completed: false
    })
}

the probelm I have is that to my understanding you cant use promises in components and if I want to get data from the database it uses promises, so how am I gonna do it then?

I tried doing this:

function App() {
  
  const taskRef = doc(db, "projects", "first task")
  const taskSnap = getDoc(taskRef)

  return (
    <div>
    {taskSnap.data()}
    </div>
  )
}

but the taskSnap is a pending promise, and I cant use async / await in the App component

about 4 years ago · Juan Pablo Isaza
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!