first of all I'm new on this form so feel free to tell me if I've forget crucial information. I would like to know how can I get data from my firestore DB displayed on my React web app, actually, i can't display the data on the console of the site but I really can't find a way to diaplay them my site.
function App() {
const TITLE = '~Siting on Clouds~'
console.log("Start");
const list_div = document.createElement("P");
db.collection('Capteur').onSnapshot(function (querySnapshot) {
querySnapshot.forEach( doc => {
console.log("Nom : ", doc.data().Nom);
console.log("Valeur : ", doc.data().Valeur);
list_div.innerHTML = '<div className="App"><p>Name :' + doc.data().Nom + '<br>Valeur : '+ doc.data().Valeur + '</brW></p></div>'
})
})
return (
<div className="App">
<header className="App-header">{TITLE}
<img src={logo} className="App-logo" alt="logo" />
<p>
Information that I want
</p>
</header>
</div>
);
}
There is my site with the information that I display in the console my web page WIP
For information I'm using React on IntelliJ