Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reactJS history push returns an error

Hi in my reactJS application I use this

this.props.history.push("URL");

to redirect to another page or to the same page when I want to reload the page.

But I got this error:

Hash history cannot PUSH the same path; a new entry will not be added to the history stack

how can I solve this issue?

thanks in advance

like image 389
Felix Avatar asked Sep 15 '25 02:09

Felix


1 Answers

I think you are looking for this

   this.props.history.push({
         pathname: "URL"
      })
like image 86
Adnan Avatar answered Sep 16 '25 15:09

Adnan