Skip to content

Commit 8717c54

Browse files
committed
Update Histories.md
1 parent 98b1ca7 commit 8717c54

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/guides/basics/Histories.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ When a history transitions around your app with `pushState` or `replaceState`, i
3333

3434
The DOM API that hash history uses to transition around is simply `window.location.hash = newHash`, with no place to store location state. But, we want all histories to be able to use location state, so we shim it by creating a unique key for each location and then store that state in session storage. When the visitor clicks "back" and "forward" we now have a mechanism to restore the location state.
3535

36-
You can disable that feature by following the instructions [here](http://rackt.org/history/stable/HashHistoryCaveats.html).
36+
You can disable that feature (more [here](http://rackt.org/history/stable/HashHistoryCaveats.html)):
37+
```js
38+
// Opt-out of persistent state, not recommended.
39+
let history = createHistory({
40+
queryKey: false
41+
});
42+
```
3743

3844
### `createBrowserHistory`
3945
Browser history is the recommended history for browser application with React Router. It uses the [History](https://developer.mozilla.org/en-US/docs/Web/API/History) API built into the browser to manipulate the URL, creating real URLs that look like `example.com/some/path`.

0 commit comments

Comments
 (0)