I have been doing this for an hour. i want to get the uid for make a table, but thats not working because the UID is outside profile. this is my database Image of my DB. Image of my Console
So far I have tried this
const [data, setData] = useState({});
useEffect(() => {
firebase
.database()
.ref("user")
.on("value", (snapshot) => {
snapshot.forEach((child) => {
const uid = child.key;
firebase
.database()
.ref("user/" + uid + "/Profil")
.on("value", (snapchild) => {
snapchild.forEach((snapshotchild) => {
if (snapshotchild.val() !== null) {
setData({ ...snapshotchild.val() });
} else {
setData({});
and like this my table
<tbody>
{Object.keys(data).map((id, index) => {
return (
<tr>
<th scope="row">{index + 1}</th>
<td>{data[id].fullName}</td>
<td>
Where might I be going wrong.