Skip to content

Commit

Permalink
Add some more type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Jun 12, 2020
1 parent 4ab6a42 commit 987ff43
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ This can be useful in situations where you need to keep track of 2 different sta

### State

```ts
type State = object | null;
```

A [`State`](https://github.com/ReactTraining/history/blob/0f992736/packages/history/index.ts#L61) value is an object of extra information that is associated with a [`Location`](#location) but that does not appear in the URL. This value is always associated with that location.

See [the Navigation guide](navigation.md) for more information.
Expand All @@ -408,6 +412,16 @@ See [the Navigation guide](navigation.md) for more information.

### To

```ts
type To = string | PartialPath;

interface PartialPath {
pathname?: string;
search?: string;
hash?: string;
}
```

A [`To`](https://github.com/ReactTraining/history/blob/0f992736/packages/history/index.ts#L212) value represents a destination location, but doesn't contain all the information that a normal [`location`](#location) object does. It is primarily used as the first argument to [`history.push`](#history.push) and [`history.replace`](#history.replace).

See [the Navigation guide](navigation.md) for more information.

0 comments on commit 987ff43

Please sign in to comment.