As per code , i want to display the customerNames
in a single array but as you see the image below. what is wrong here please can anyone help me thanks in advance
const [names, setNames] = React.useState([]);
socket.on('customers', function (customerNames) =>{
setNames([...names, customerNames])
})
useEffect(() => console.log(names), [names])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…