Skip to content

Weird Bugs

saphknight edited this page Apr 2, 2019 · 10 revisions
  • When doing the handleSubmit for, VS Code auto-imported App from app.jsx and App.cable would return null
  • Had trouble passing in both user_id and message body without losing one or the other. Had to pass in both as separate keys in data for the ActionChannel chat_channel.rb
  • Upon moving all the logic from ChatRoom to Channel and changing ChatRoom to a component that renders both Channel and Sidebar, the site would repeatedly run into an infinite loop. This was due to the fact that Sidebar originally had logic that would render ChatRoom next to it and this ended up causing Sidebar to render ChatRoom and ChatRoom to render Sidebar
  • Chat was only changing on refreshing the page. Had to add an unsub method, call it in componentDidUpdate and also resubscribe. Also have to add the conditional that the prevProps.currentChannel.id !== this.props.currentChannel.id to make sure it doesn't cause an infinite loop -[] Making /messages a ProtectedRoute doesn't go directly to messages on login or signup
Clone this wiki locally