UNPKG

1.75 kBJavaScriptView Raw
1/**
2 * react-router v8.0.0
3 *
4 * Copyright (c) Remix Software Inc.
5 *
6 * This source code is licensed under the MIT license found in the
7 * LICENSE.md file in the root directory of this source tree.
8 *
9 * @license MIT
10 */
11import * as React$1 from "react";
12//#region lib/context.ts
13const DataRouterContext = React$1.createContext(null);
14DataRouterContext.displayName = "DataRouter";
15const DataRouterStateContext = React$1.createContext(null);
16DataRouterStateContext.displayName = "DataRouterState";
17const RSCRouterContext = React$1.createContext(false);
18function useIsRSCRouterContext() {
19 return React$1.useContext(RSCRouterContext);
20}
21const ViewTransitionContext = React$1.createContext({ isTransitioning: false });
22ViewTransitionContext.displayName = "ViewTransition";
23const FetchersContext = React$1.createContext(/* @__PURE__ */ new Map());
24FetchersContext.displayName = "Fetchers";
25const AwaitContext = React$1.createContext(null);
26AwaitContext.displayName = "Await";
27const AwaitContextProvider = (props) => React$1.createElement(AwaitContext.Provider, props);
28const NavigationContext = React$1.createContext(null);
29NavigationContext.displayName = "Navigation";
30const LocationContext = React$1.createContext(null);
31LocationContext.displayName = "Location";
32const RouteContext = React$1.createContext({
33 outlet: null,
34 matches: [],
35 isDataRoute: false
36});
37RouteContext.displayName = "Route";
38const RouteErrorContext = React$1.createContext(null);
39RouteErrorContext.displayName = "RouteError";
40//#endregion
41export { AwaitContext, AwaitContextProvider, DataRouterContext, DataRouterStateContext, FetchersContext, LocationContext, NavigationContext, RSCRouterContext, RouteContext, RouteErrorContext, ViewTransitionContext, useIsRSCRouterContext };