Commit aded789a authored by JeongYeonwoo's avatar JeongYeonwoo
Browse files

socket연결

parent 216a1640
...@@ -14,6 +14,7 @@ function Chat(props) { ...@@ -14,6 +14,7 @@ function Chat(props) {
} }
return ( return (
<div className="chat" id="chat" style={{ border: "2px solid", height: "300%", margin: "1%", borderColor: "#BDBDBD" }}> <div className="chat" id="chat" style={{ border: "2px solid", height: "300%", margin: "1%", borderColor: "#BDBDBD" }}>
<Button variant="light" onClick={props.handleChatc} >{`<`}</Button> <Button variant="light" onClick={props.handleChatc} >{`<`}</Button>
<h2>현재 {props.roomName} 입니다.</h2> <h2>현재 {props.roomName} 입니다.</h2>
......
...@@ -59,9 +59,10 @@ function Home() { ...@@ -59,9 +59,10 @@ function Home() {
console.log('msg', msg) console.log('msg', msg)
console.log('inner :', inner) console.log('inner :', inner)
setChat([...chatmsg, msg]) setChatmsg([...chatmsg, msg])
console.log('useeffect2', chatmsg)
}) })
console.log('useeffect2', chat) console.log('useeffect2', chatmsg)
}, [chatmsg]) }, [chatmsg])
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
......
...@@ -60,7 +60,7 @@ app.get('/', (req, res) => { ...@@ -60,7 +60,7 @@ app.get('/', (req, res) => {
res.send('Hello World. 안녕하세요') res.send('Hello World. 안녕하세요')
}) })
app.listen(3030, () => { server.listen(3030, () => {
console.log('Listening on port 3030') console.log('Listening on port 3030')
}) })
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment