express connected to react
This commit is contained in:
@@ -14,8 +14,9 @@ function App() {
|
||||
}, [setSocket]);
|
||||
|
||||
useEffect(() => {
|
||||
socket.on('connection', () => {
|
||||
console.log(socket.id);
|
||||
if (!socket) return;
|
||||
socket.on('connection', (data) => {
|
||||
console.log('connected!' + data);
|
||||
})
|
||||
}, [socket]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user