react-firebase-hooks
react-firebase-hooks copied to clipboard
useList for Real-time Databae returns object list?
Using the example found here
snapshots.map((v) => {
console.log(v.val())
})
returns { id: { name: "hello" }, id2: {} ... } but when I try to console.log(v.val().name) it returns undefined? and also I thought response would be an array of objects. My database below:
- users
- uniqueId (used push to generate key)
- { name: "hello }
try to console log v.val()['name'], you get data as json (key,value) so try this
console.log(v.val()['name'])
Closing due to inactivity. Feel free to reopen if this is still an issue