My question is as follows, how can I get just one name from the database since it is throwing me more than one name example of how it looks
Now I just want to get the name of the login ID and not both
I attach the code I'm using
class HomePage extends Component {
constructor(props) {
super(props);
this.state = {
users: {}
};
}
componentDidMount() {
db.onceGetUsers().then(snapshot =>
this.setState(() => ({
users: snapshot.val()
}))
);
}
render() {
const { users } = this.state;
return (
<div className="App">
<h1>Home</h1>
<p>Todos los usuarios que inician sesión tienen acceso a la Página de inicio.</p>
{ !!users && <UserList users={users} /> }
</div>
);
}
}
const UserList = ({ users }) =>
<div className="App">
{Object.keys(users).map(key =>
<div key={key}>{users[key].username}</div>
)}
</div>
const authCondition = (authUser) => !!authUser;
export default withAuthorization(authCondition)(HomePage);
same as an image of the reference of the db
& in advance thank you very much for the help.