1

I have a simple inbox page that opens user messages. The trouble is that when a user clicks a message from the inbox from the inbox page...nothing happens. I understand why this is the case for push but for replace it seems like a bug.

Attempting as so:

this.props.history.replace({
              pathname: "/inbox",
              state: { chatID: targetID }
            });
notElonMusk
  • 314
  • 1
  • 4
  • 21
  • Here's the usage from react-router docs `replace(path, [state]) - (function) Replaces the current entry on the history stack` So you may try this or some other combination: `this.props.history.replace("/inbox", { chatID: targetID });` – Rikin Aug 12 '19 at 15:39
  • @Rikin thanks but that has the same behavoir – notElonMusk Aug 13 '19 at 06:36
  • fixed. Had to do with me not checking for the change in shouldComponentUpdate – notElonMusk Aug 13 '19 at 20:24

0 Answers0