UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

20 lines 791 B
import { createContext, useContext } from 'react'; import { reactRouterProvider } from "./adapters/reactRouterProvider.js"; /** * Context for providing the router provider throughout the application. * Defaults to react-router provider, so existing apps work without changes. */ export const RouterProviderContext = createContext(reactRouterProvider); RouterProviderContext.displayName = 'RouterProviderContext'; /** * Hook to access the current router provider. * Used internally by ra-core hooks and components to access routing primitives. * * @example * const provider = useRouterProvider(); * const location = provider.useLocation(); */ export const useRouterProvider = () => { return useContext(RouterProviderContext); }; //# sourceMappingURL=RouterProviderContext.js.map