0

I am thinking of not using window reload() but only react router 4 after this code:

this.props.history.push('/myPath')

then refresh the browser, is there a way to refresh the browser with react router 4?

gpbaculio
  • 5,693
  • 13
  • 60
  • 102

1 Answers1

1

You can just use location.reload();. There's no need for react-router to refresh.

Taken from SO

technogeek1995
  • 3,185
  • 2
  • 31
  • 52
  • this works, i was trying to find a way by using react router 4 not this, I hope there was – gpbaculio Jul 09 '19 at 19:41
  • in the linked question, there are several ways to do it. Some of them are through `react-router`. The top answer was not through `react-router`, which happened to be the one I added. You should read through the answers to the linked question. – technogeek1995 Jul 09 '19 at 19:43