diff --git a/components/popconfirm/PurePanel.tsx b/components/popconfirm/PurePanel.tsx index 9baa90f523fe..a16031b5ddda 100644 --- a/components/popconfirm/PurePanel.tsx +++ b/components/popconfirm/PurePanel.tsx @@ -11,6 +11,7 @@ import { useLocale } from '../locale'; import defaultLocale from '../locale/en_US'; import PopoverPurePanel from '../popover/PurePanel'; import useStyle from './style'; +import useCSSVar from './style/cssVar'; export interface PopconfirmLocale { okText: string; @@ -108,9 +109,10 @@ const PurePanel: React.FC = (props) => { const { getPrefixCls } = React.useContext(ConfigContext); const prefixCls = getPrefixCls('popconfirm', customizePrefixCls); - const [wrapSSR] = useStyle(prefixCls); + useStyle(prefixCls); + const wrapCSSVar = useCSSVar(prefixCls); - return wrapSSR( + return wrapCSSVar( ((props, ref) => const prefixCls = getPrefixCls('popconfirm', customizePrefixCls); const overlayClassNames = classNames(prefixCls, overlayClassName); - const [wrapSSR] = usePopconfirmStyle(prefixCls); + usePopconfirmStyle(prefixCls); + const wrapCSSVar = useCSSVar(prefixCls); - return wrapSSR( + return wrapCSSVar( = (token) => { }; // ============================== Export ============================== +export const prepareComponentToken: GetDefaultToken<'Popconfirm'> = (token) => { + const { zIndexPopupBase } = token; + + return { + zIndexPopup: zIndexPopupBase + 60, + }; +}; + export default genComponentStyleHook( 'Popconfirm', (token) => genBaseStyle(token), - (token) => { - const { zIndexPopupBase } = token; - - return { - zIndexPopup: zIndexPopupBase + 60, - }; - }, + prepareComponentToken, { resetStyle: false, }, diff --git a/scripts/check-cssinjs.tsx b/scripts/check-cssinjs.tsx index 332f1748799c..e496f9d1224f 100644 --- a/scripts/check-cssinjs.tsx +++ b/scripts/check-cssinjs.tsx @@ -55,7 +55,6 @@ async function checkCSSVar() { 'message', 'notification', 'pagination', - 'popconfirm', 'progress', 'qr-code', 'radio',