this is my realtime-database
.
I dont know how i can get the child value on profile. In this case i use reactjs and firebase.
const Database = () => {
const [data, setData] = useState({});
useEffect(() => {
fire.child("Profil").on("value", (snapshot) => {
if (snapshot.val() !== null) {
setData({ ...snapshot.val() });
} else {
setData({});
}
});
return () => {
setData({});
};
}, []);
return (
<tbody>
{Object.keys(data).map((id, index) => {
return (
<tr>
<th scope="row">{index + 1}</th>
<td>{data[id].email}</td>
</tr>
);
})}
</tbody>
export default Database;