DEV Community

Midhun Krishnan R
Midhun Krishnan R

Posted on

The best way to programatically reload in JS or React JS

You all know that the window.location.reload(true) is now deprecated. It would show a lint error showing Expected 0 arguments, but got 1.

So that an alternative to window.location.reload(true) is:

window.location.replace(window.location.href)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)