UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

27 lines (24 loc) 871 B
import React, { memo, useMemo } from 'react'; import { getContext, Symbols } from 'choerodon-ui/shared'; import { getPrefixCls } from '../configure/utils'; var ListContext = getContext(Symbols.ListContext, { getPrefixCls: getPrefixCls }); var BaseListContextProvider = function ListContextProvider(props) { var children = props.children, grid = props.grid, getGlobalPrefixCls = props.getPrefixCls; var value = useMemo(function () { return { grid: grid, getPrefixCls: getGlobalPrefixCls }; }, [getGlobalPrefixCls, grid]); return /*#__PURE__*/React.createElement(ListContext.Provider, { value: value }, children); }; BaseListContextProvider.displayName = 'ListContextProvider'; export var ListContextProvider = /*#__PURE__*/memo(BaseListContextProvider); export default ListContext; //# sourceMappingURL=ListContext.js.map