@yuntijs/ui
Version:
☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps
15 lines • 597 B
JavaScript
import { createContext, memo, useContext } from 'react';
import { jsx as _jsx } from "react/jsx-runtime";
export var MentionsConfigContext = /*#__PURE__*/createContext(null);
export var MentionsConfigProvider = /*#__PURE__*/memo(function (_ref) {
var children = _ref.children,
value = _ref.value;
return /*#__PURE__*/_jsx(MentionsConfigContext.Provider, {
value: value,
children: children
});
});
export var useOptionsMap = function useOptionsMap() {
var config = useContext(MentionsConfigContext);
return config === null || config === void 0 ? void 0 : config.optionsMap;
};