useEffect(() => {
socket.on(
'message',
({ user_id, contents, createdAt }) => {
console.log('소캣온 잘 받고 있나요 ? ', user_id, contents, createdAt)
dispatch({
type: 'ADD_MESSAGE',
payload: {
contents: contents,
profileImage: socketParticipant[user_id]['profileImage'] || '',
name: socketParticipant[user_id]['name'] || '??',
createdAt: timeSetting(createdAt) || createdAt
}
});
},
(error) => {
console.log('why error?',error);
}
);
}, []);
소캣 예민하다. 꼭 || null
넣어조라..