inseokr / MERN_linkedspace

2 stars 1 forks source link

Problem in main chatting window #140

Open inseokr opened 4 years ago

inseokr commented 4 years ago

Infinite rendering problem observed.

inseokr commented 4 years ago

reset C:/webdev/mern/MERN_linkedspace/src/client/contexts/MessageContext.js:81 78 | { 79 | console.log("MessageContext: being reset"); 80 | console.log("MessageContext: current channel name = " + currChannelInfo.channelName );

81 | setChannelContexts([]); 82 | setChannelContextLength(0); 83 | setNumOfMsgHistory(0); 84 | setNewMsgArrived(false);

inseokr commented 4 years ago

× Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops. ▶ 4 stack frames were collapsed. reset C:/webdev/mern/MERN_linkedspace/src/client/contexts/MessageContext.js:81 78 | { 79 | console.log("MessageContext: being reset"); 80 | console.log("MessageContext: current channel name = " + currChannelInfo.channelName );

81 | setChannelContexts([]); 82 | setChannelContextLength(0); 83 | setNumOfMsgHistory(0); 84 | setNewMsgArrived(false); View compiled GeneralChatMainPage C:/webdev/mern/MERN_linkedspace/src/client/container/GeneralChatPage/GeneralChatMainPage.js:31 28 | { 29 | // ISEO-TBD: switching to "2" will be possible only within the dashboard?? 30 | console.log("ISEO: need to re-initialize the context: full mode"); 31 | reset(0); 32 | } 33 | 34 |

inseokr commented 4 years ago

Not sure what's happening.. .but the problem went away after converting it back to component.