UNPKG

@harvest-profit/npk

Version:
16 lines 865 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NavigationContextProvider = exports.defaultNavigationConfig = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); exports.defaultNavigationConfig = { as: 'a', hrefProp: 'href', matchWith: (href, locationPath) => locationPath.endsWith(href), transformPath: (href, locationPath) => href, }; const NavigationContext = (0, react_1.createContext)(exports.defaultNavigationConfig); exports.default = NavigationContext; const NavigationContextProvider = ({ config = {}, children }) => ((0, jsx_runtime_1.jsx)(NavigationContext.Provider, { value: { ...exports.defaultNavigationConfig, ...config }, children: children })); exports.NavigationContextProvider = NavigationContextProvider; //# sourceMappingURL=NavigationContext.js.map