Help need to fetch from database

New to firebase . need to show some data(database has 1)name 2)location 3)commission) from database in the content area.

database.ref('Agents').on('value',(snapshot) => {
  const Agents =[];
  snapshot.forEach((childSnapshot) =>{
   Agents.push({
      id:childSnapshot.key,
      ...childSnapshot.val()
    });
  });
  console.log(Agents);
});

this code showing datas in console but I need to show in content area. Help !!

<Content style={{ padding: '0 24px', minHeight: 450 }}>
          
 // fetch data from database --- database name:Agents

         Content 
        </Content>

are you using a framework like react or express by any chance?

i dont know a whole lot about firebase but you said you can see your data in the console so thats good.

Youre gonna have to set up a server to serve your data to the browser. check out expressjs for setting up routes for displaying your data in the browser.

am using reactjs. and setting routes by react

I don’t see what do routes have to do with anything here.

If the Agents is in the scope of the Content component, and the data exists before the component is rendered, you can display it like this:

<Content>
  {Agents}
</Content>

If you are still stuck, read an article or two about React.js state and how to update it.