1 | if (__DEV__) {
|
2 | if (typeof window !== "undefined") {
|
3 | const global = window;
|
4 | const key = "__react_router_build__";
|
5 | const buildNames = { cjs: "CommonJS", esm: "ES modules", umd: "UMD" };
|
6 |
|
7 | if (global[key] && global[key] !== process.env.BUILD_FORMAT) {
|
8 | const initialBuildName = buildNames[global[key]];
|
9 | const secondaryBuildName = buildNames[process.env.BUILD_FORMAT];
|
10 |
|
11 |
|
12 |
|
13 | throw new Error(
|
14 | `You are loading the ${secondaryBuildName} build of React Router ` +
|
15 | `on a page that is already running the ${initialBuildName} ` +
|
16 | `build, so things won't work right.`
|
17 | );
|
18 | }
|
19 |
|
20 | global[key] = process.env.BUILD_FORMAT;
|
21 | }
|
22 | }
|
23 |
|
24 | export { default as MemoryRouter } from "./MemoryRouter.js";
|
25 | export { default as Prompt } from "./Prompt.js";
|
26 | export { default as Redirect } from "./Redirect.js";
|
27 | export { default as Route } from "./Route.js";
|
28 | export { default as Router } from "./Router.js";
|
29 | export { default as StaticRouter } from "./StaticRouter.js";
|
30 | export { default as Switch } from "./Switch.js";
|
31 | export { default as generatePath } from "./generatePath.js";
|
32 | export { default as matchPath } from "./matchPath.js";
|
33 | export { default as withRouter } from "./withRouter.js";
|
34 |
|
35 | import { useHistory, useLocation, useParams, useRouteMatch } from "./hooks.js";
|
36 | export { useHistory, useLocation, useParams, useRouteMatch };
|
37 |
|
38 | export { default as __HistoryContext } from "./HistoryContext.js";
|
39 | export { default as __RouterContext } from "./RouterContext.js";
|