choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
27 lines (24 loc) • 960 B
JavaScript
import React, { memo, useMemo } from 'react';
import { getContext, Symbols } from 'choerodon-ui/shared';
import { getPrefixCls } from '../configure/utils';
var CheckboxContext = getContext(Symbols.CheckboxContext, {
getPrefixCls: getPrefixCls
});
var BaseCheckboxContextProvider = function CheckboxContextProvider(props) {
var children = props.children,
checkboxGroup = props.checkboxGroup,
getGlobalPrefixCls = props.getPrefixCls;
var value = useMemo(function () {
return {
checkboxGroup: checkboxGroup,
getPrefixCls: getGlobalPrefixCls
};
}, [getGlobalPrefixCls, checkboxGroup]);
return /*#__PURE__*/React.createElement(CheckboxContext.Provider, {
value: value
}, children);
};
BaseCheckboxContextProvider.displayName = 'CheckboxContextProvider';
export var CheckboxContextProvider = /*#__PURE__*/memo(BaseCheckboxContextProvider);
export default CheckboxContext;
//# sourceMappingURL=CheckboxContext.js.map