You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
InternshipProject/node_modules/rc-menu/es/context/PathContext.js

16 lines
782 B

import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import * as React from 'react';
var EmptyList = [];
export var PathRegisterContext = /*#__PURE__*/React.createContext(null);
export function useMeasure() {
return React.useContext(PathRegisterContext);
} // ========================= Path Tracker ==========================
export var PathTrackerContext = /*#__PURE__*/React.createContext(EmptyList);
export function useFullPath(eventKey) {
var parentKeyPath = React.useContext(PathTrackerContext);
return React.useMemo(function () {
return eventKey !== undefined ? [].concat(_toConsumableArray(parentKeyPath), [eventKey]) : parentKeyPath;
}, [parentKeyPath, eventKey]);
}
export var PathUserContext = /*#__PURE__*/React.createContext(null);