sdy

add empty array in useEffect

......@@ -156,7 +156,7 @@ export default ({
}) => {
const { pathname } = location;
const roomName = pathname.slice(1, pathname.length);
useEffect(() => subscribeToNewMessage());
useEffect(() => subscribeToNewMessage(), []);
return (
<Wrapper>
......@@ -176,20 +176,18 @@ export default ({
</ChatMenuContainer>
<ChatScreenContainer>
<ChatScreenHeader>
<Title>Selected Menu Title</Title>
<Title>{roomName}</Title>
</ChatScreenHeader>
<ChatScreenBox>
<ul>
{messageArray &&
messageArray.seeAllMessage.map((e) => (
<Message
text={e.text}
time={e.createdAt}
key={e.id}
avatar={e.sender.avatarUrl}
/>
))}
</ul>
{messageArray &&
messageArray.seeAllMessage.map((e) => (
<Message
text={e.text}
time={e.createdAt}
key={e.id}
avatar={e.sender.avatarUrl}
/>
))}
<InputContainer className="InputContainer">
<form onSubmit={onSubmit}>
<Input
......