Skip to content

Commit 53759d4

Browse files
committed
Update API reference links
1 parent fc0c588 commit 53759d4

1 file changed

Lines changed: 25 additions & 8 deletions

File tree

docs/api-reference.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
# API Reference
22

3-
This document is a comprehensive API reference for [the "history" JavaScript
3+
This document is a comprehensive API reference for [the history JavaScript
44
library](https://github.com/ReactTraining/history).
55

66
Although there are several interfaces in the history library, the main
77
interfaces are:
88

99
- The create* methods:
10-
- [`createBrowserHistory`](#createbrowserhistory-window-window-)
11-
- [`createHashHistory`](#createhashhistory-window-window-)
12-
- [`createMemoryHistory`](#creatememoryhistory-initialentries-initialentry-initialindex-number-)
10+
- [`createBrowserHistory({ window?: Window })`](#createbrowserhistory-window-window-)
11+
- [`createHashHistory({ window?: Window })`](#createhashhistory-window-window-)
12+
- [`createMemoryHistory({ initialEntries?: InitialEntry[], initialIndex?: number })`](#creatememoryhistory-initialentries-initialentry-initialindex-number-)
1313
- The [`History`](#history) interface
14+
- [`history.action`](#historyaction)
15+
- [`history.location`](#historylocation)
16+
- [`history.createHref(to: To)`](#historycreatehrefto-to)
17+
- [`history.push(to: To, state?: State)`](#historypushto-to-state-state)
18+
- [`history.replace(to: To, state?: State)`](#historyreplaceto-to-state-state)
19+
- [`history.go(delta: number)`](#historygodelta-number)
20+
- [`history.back()`](#historyback)
21+
- [`history.forward()`](#historyforward)
22+
- [`history.listen(listener: Listener)`](#historylistenlistener-listener)
23+
- [`history.block(blocker: Blocker)`](#historyblockblocker-blocker)
1424
- The [`Location`](#location) interface
25+
- [`location.pathname`](#locationpathname)
26+
- [`location.search`](#locationsearch)
27+
- [`location.hash`](#locationhash)
28+
- [`location.state`](#locationstate)
29+
- [`location.key`](#locationkey)
30+
- The [`Action`](#action) enum
31+
- The [`To`](#to) type alias
1532

1633
## `createBrowserHistory({ window?: Window })`
1734

@@ -75,7 +92,7 @@ interface History&lt;S extends <a href="https://github.com/ReactTraining/history
7592
<a href="#historycreatehrefto-to">createHref</a>(to: <a href="#to">To</a>): string;
7693
<a href="#historypushto-to-state-state">push</a>(to: <a href="#to">To</a>, state?: S): void;
7794
<a href="#historyreplaceto-to-state-state">replace</a>(to: <a href="#to">To</a>, state?: S): void;
78-
<a href="#historygodelta">go</a>(n: number): void;
95+
<a href="#historygodelta-number">go</a>(n: number): void;
7996
<a href="#historyback">back</a>(): void;
8097
<a href="#historyforward">forward</a>(): void;
8198
<a href="#historylistenlistener-listener">listen</a>(listener: Listener&lt;S&gt;): () => void;
@@ -174,9 +191,9 @@ information.
174191

175192
## Location
176193

177-
The word "location" in React Router refers to a particular entry in the history
178-
stack, usually analogous to a "page" or "screen" in your app. As the user clicks
179-
on links and moves around the app, the location changes.
194+
A `location` is a particular entry in the history stack, usually analogous to a
195+
"page" or "screen" in your app. As the user clicks on links and moves around the
196+
app, the current location changes.
180197

181198
A `location` object has the following interface:
182199

0 commit comments

Comments
 (0)