my question is and I am probably going about this wrong but I have statefull object to hold a property of name: that when the user writes a name for it is saved in the object as type name. That works but i need to have the ability to create another also of type name in the same objct.

this is how I am initializing my state

```
const [deptData, setDeptData] = useState({
        name: ''
    })

```

this is how implementing the first value collected which works

```
 const handleChange = (e) => {
        let value = e.target.value;
        setDeptData({name: value})
    }

```

Then on the second create I have this which is overriding my previous value.

```
 const handleChange = (e) => {
        let value = e.target.value;
        setDeptData({...deptData, name: value})

```

I want to capture as let departments = [
{
"name": "name1",
},
{
"name": "name1",
},
{
"name": "name1",
},
{
...
},
{
...
},
...
]

any help on this will be appreciated