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

294
Views
TypeError: Object(...) no es una función cuando se conecta con Firebase

Entonces, estaba siguiendo un tutorial sobre un clon de messenger y usaron Firebase. Cuando usé esa sintaxis, me mostró un error y luego descubrí que cambiaron toda la sintaxis. Así que traté de hacer las cosas de esta manera y me está dando este tipo de error.

 import db from "./firebase"; import { doc,onSnapshot,collection,query } from 'firebase/firestore'; ..... ..... const [messages, setMessages] = useState([ {username: "Shuvo", message: "What's up"}, {username:"Arnob",message:"Hi"}]); useEffect(()=>{ const q = query(collection(db,"messages")); const hello = onSnapshot(q,(querySnapshot)=>{ setMessages(querySnapshot.docs.map(doc => doc.data())) }) },[]) .....
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 useEffect(()=>{ const ref = firebase.firestore().collection('messages') ref.onSnapshot((querySnapshot)=>{ const items = [] querySnapshot.forEach((doc)=> items.push(doc.data())) setMessages(items) })
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!