Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How to solve the TS type error when trying to get firebase data by using orderByChild?

$
0
0

I need to get all the players ordered by their points from Firebase(V9) Realtime Database.I tried to fetch them as it is instructed in the docs.

But ref(db, 'usersPoints') throws this TypeScript error:

Argument of type 'DatabaseReference' is not assignable to parameter of type 'Query<unknown>'. Type 'DatabaseReference' is missing the following properties from type 'Query<unknown>': converter, type, firestore, withConverter

Here is the code:

const db = getDatabase();const playersByPoints = query(ref(db, "usersPoints"), orderByChild("points"));

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>