Skip to content

Commit a3cc1c1

Browse files
committed
Merge branch 'SevenOutman-improve-dts' into dev
2 parents e62360d + e8c0b66 commit a3cc1c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/history/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export interface Location<S extends State = State> extends Path {
102102
*
103103
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.state
104104
*/
105-
state: S;
105+
state: S | null;
106106

107107
/**
108108
* A unique string associated with this location. May be used to safely store
@@ -123,7 +123,7 @@ export type PartialPath = Partial<Path>;
123123
/**
124124
* A partial Location object that may be missing some properties.
125125
*/
126-
export type PartialLocation = Partial<Location>;
126+
export type PartialLocation<S extends State = State> = Partial<Location<S>>;
127127

128128
/**
129129
* A change to the current location.
@@ -216,7 +216,7 @@ export interface History<S extends State = State> {
216216
*
217217
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.push
218218
*/
219-
push(to: To, state?: S): void;
219+
push(to: To, state?: S | null): void;
220220

221221
/**
222222
* Replaces the current location in the history stack with a new one. The
@@ -227,7 +227,7 @@ export interface History<S extends State = State> {
227227
*
228228
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.replace
229229
*/
230-
replace(to: To, state?: S): void;
230+
replace(to: To, state?: S | null): void;
231231

232232
/**
233233
* Navigates `n` entries backward/forward in the history stack relative to the

0 commit comments

Comments
 (0)