You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading the chat page for the first time, it works just fine. When reloading the page (CMD + R), the chat page works just fine. But if I click over to another url in my app, and then click back to chat, I get an error. Upon refreshing the page, the chat renders fine.
See the gif below:
The error is occurring with the getMyLastMessage function buried within the ChatFeed component:
I can probably get around this by using a custom component with a render hook, but I'd like to avoid that. I have investigated this for some time and it seems like it could be another silly react thing or perhaps a websocket thing I am not privy too.
I have an update on this one...this bug happens when you have the ChatEngineWrapper wrapped around my entire react-router implementation. Only wrapping the elements on the ChatApp page with the wrapper fixed the issue. I do still think it is a bug however, since I think the chat engine wrapper should be robust to accessing state even when the primary ChatEngine component is not mounted, for things like multi-page chat applications. Think LinkedIn or Facebook...you have a dedicated page for chat, but you also can access the chat feature globally from the top right.
I know I could probably rewrite my entire application to sit beneath the ChatEngine component, but that seems like a force. Let me know if anyone else has opinions.
When loading the chat page for the first time, it works just fine. When reloading the page (CMD + R), the chat page works just fine. But if I click over to another url in my app, and then click back to chat, I get an error. Upon refreshing the page, the chat renders fine.
See the gif below:
The error is occurring with the
getMyLastMessage
function buried within theChatFeed
component:I can probably get around this by using a custom component with a
render
hook, but I'd like to avoid that. I have investigated this for some time and it seems like it could be another silly react thing or perhaps a websocket thing I am not privy too.Here is my code that mounts the ChatEngine
I am using react-router to handle the navigation between the pages seen in the gif above. I am NOT running in strict mode.
The text was updated successfully, but these errors were encountered: