t); } function useLocation() { { !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useLocation()") : void 0; } return useContext(context).location; } function useParams() { { !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useParams()") : void 0; } var match = useContext(context).match; return match ? match.params : {}; } function useRouteMatch(path) { { !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useRouteMatch()") : void 0; } var location = useLocation(); var match = useContext(context).match; return path ? matchPath(location.pathname, path) : match; } { if (typeof window !== "undefined") { var global$1 = window; var key = "__react_router_build__"; var buildNames = { cjs: "CommonJS", esm: "ES modules", umd: "UMD" }; if (global$1[key] && global$1[key] !== "umd") { var initialBuildName = buildNames[global$1[key]]; var secondaryBuildName = buildNames["umd"]; // TODO: Add link to article that explains in detail how to avoid // loading 2 different builds. throw new Error("You are loading the " + secondaryBuildName + " build of React Router " + ("on a page that is already running the " + initialBuildName + " ") + "build, so things won't work right."); } global$1[key] = "umd"; } } exports.MemoryRouter = MemoryRouter; exports.Prompt = Prompt; exports.Redirect = Redirect; exports.Route = Route; exports.Router = Router; exports.StaticRouter = StaticRouter; exports.Switch = Switch; exports.__HistoryContext = historyContext; exports.__RouterContext = context; exports.generatePath = generatePath; exports.matchPath = matchPath; exports.useHistory = useHistory; exports.useLocation = useLocation; exports.useParams = useParams; exports.useRouteMatch = useRouteMatch; exports.withRouter = withRouter; Object.defineProperty(exports, '__esModule', { value: true }); })); //# sourceMappingURL=react-router.js.map