Question: I can see in this file (<https://github.com/ReactTraining/react-router/blob/v0.13.3/modules/createRouter.js>) that there is a refresh function but I have no idea how to call it. I'm fairly new to react-router, I've only used it to move between some pages a couple times using hashHistory. 

Right now I am trying to use it so that when an install fails, the user is given the option to 'retry' which I plan to execute by refreshing the page where the install happens (the page the user would be currently on). Any help would be appreciated.

This is a node app that runs on electron, not a web app.

Answer: 
firstly, add react-router as a dependency

```
`yarn add react-router` or `npm install react-router`

import { useHistory } from 'react-router'

```

`const history = useHistory()`

```
/////then add this to the function that is called for re-rendering

```

`history.go(0)`

This causes your page to re-render automatically
If you don't want to reload all scripts again you can replace the current path with a fake/empty path and replace it again with the current path like this

```js
// ...
let currentPath = window.location.pathname;
history.replace('/your-empty-route');
setTimeout(() => {
    history.replace(currentPath)
}, 0)
// ...

```

**Update:**

If the changing of the address bar bothering, you can add a patterned route like this:

```
<Route path="/*/reload" component={null}/>

```

and add `/replace` to the end of `currentPath` to replace the router with null component. like this:

```js
// ...
let currentPath = window.location.pathname;
history.replace(`${currentPath}/replace`);
setTimeout(() => {
    history.replace(currentPath)
}, 0)
// ...

```

In this way, the `reload` keyword will add to the end of your current path and I think it's more user friendly.

**Notice**: If you already have a route that ends with **replace** It will cause conflict. To solve that you should change the path of the patterned route to something else.