I am trying to create a useState hook matching to this object:
[
{
"id":"",
"name":""
}
]
This is how my code is looking like:
const [ galleries, setGalleries ] = useState([
{
id: "",
name: ""
}
])
setGalleries({...galleries, id: gallery.id, name: gallery.name})