Thanks… it’s working (Y)
import firebase from "firebase"
require("firebase/firestore");
// Initialize Firebase
var config = {
apiKey: "XXXX",
authDomain: "XXX.firebaseapp.com",
databaseURL: "https://XXXX.firebaseio.com",
projectId: "XXX",
storageBucket: "XXX.appspot.com",
messagingSenderId: "XXXX"
};
firebase.initializeApp(config);
var db = firebase.firestore();
.
.
.
.
componentDidMount(){
var db = firebase.firestore();
var docRef = db.collection("users");
const output = {};
docRef.limit(50)
.get()
.then(querySnapshot => {
querySnapshot.docs.map(function (documentSnapshot) {
return (output[documentSnapshot.id] = documentSnapshot.data());
});
this.setState({dataSource: Object.entries(output)}) ;
console.log("datasource:", this.state.dataSource );
});
}