I have an array with objects that also contain array. How can I push element to that array inside object using useState?
const [list, updateList] = useState([defaultList]);
const defaultList = [
{
"name":"Element 1",
"subList": [{"name": "Element 1"}]
}
]
How can I update subList in that case?