강의

멘토링

커뮤니티

Inflearn Community Q&A

kimyu28jin6568's profile image
kimyu28jin6568

asked

Learn React and Firebase by following along - Creating a Chat Application [Renewed in December 2023]

privateRoom이 아닐때 렌더링이 안됩니당...

Written on

·

145

0

public방일때는 방장의 정보를 보여주고 private방일때는 방장의 정보가 없어야하잖아요 !

private방일때는 렌더링이 안되게 해주고 state에서도 true로 변하는데

이렇게 에러메세지가 떠요.. 보니까 먼저 에러메세지가 뜨고 state가 바뀌는데 어떻게 해야하나요?..

firebase웹앱react

Answer 1

0

John Ahn님의 프로필 이미지
John Ahn
Instructor

안녕하세요 그러면 리덕스 스토어에서 값이 늦게 가져와져서 나는 에러일까요 ? 
혹시    chatPage 파일에서 

<div style={{ width: '100%' }}>
<MainPanel
key={currentChatRoom && currentChatRoom.id} // 이게 없으면 MainPanel 에서 그냥 componentDidUMount 해서 메시지 데이터가 안가져와진다.
/>
</div>

여기 MainPanel에 key를 넣어주셨나요 ? 

kimyu28jin6568's profile image
kimyu28jin6568

asked

Ask a question