score:7

Accepted answer

useStates return an array, not an object...

So you can change

const { cities, setCities } = useState([]);

to

const [ cities, setCities ] = useState([]);

And it should work.


Related Query

More Query from same tag