Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 141980

How to get Firebase Cloud Firestore data in one line that returns one value in React Native

$
0
0

I am trying to get data from a firebase cloud firestore database in one line in a Text component in react native. Here is what I am trying to do:

...
<Text style={styles.name}>
 {firebase.firestore().collection("users").doc(post.uid).get().name}
</Text>
...

This code is trying to place a value in a React Native Text component by fetching a document with id "post.uid" so that the document data is returned where the value "name" is called and returns a single string. I would appreciate any help on how to do this as I am not able to figure out the solution. Thank you in advance!


Viewing all articles
Browse latest Browse all 141980

Trending Articles