I can not access my state in socket io useEffect

前端 未结 0 586
耶瑟儿~
耶瑟儿~ 2021-02-04 15:14

I have this code

  const [messages, setMessages] = useState([]);

and

useEffect(() => {
        socket.current.on("newMessa         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题