generated from kriasoft/react-starter-kit
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhistory.ts
26 lines (22 loc) · 745 Bytes
/
history.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* SPDX-FileCopyrightText: 2014-present Kriasoft <hello@kriasoft.com> */
/* SPDX-License-Identifier: MIT */
import type {
History as HistoryBase,
Location as LocationBase,
State,
} from "history";
import { Action } from "history";
import * as React from "react";
export type History = HistoryBase<State>;
export type Location = LocationBase<State>;
// Provide the default history object (for unit testing)
export const HistoryContext = React.createContext<History>({
action: Action.Pop,
location: { key: "", pathname: "/", search: "" },
} as History);
// Provide the default location object (for unit testing)
export const LocationContext = React.createContext<Location>({
key: "",
pathname: "/",
search: "",
} as Location);