mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
fix: delete defaultprops (#37827)
This commit is contained in:
parent
e47e418c09
commit
3e2e12e98e
@ -31,7 +31,7 @@ export interface OverlayProps
|
||||
onCancel?: React.MouseEventHandler<HTMLButtonElement>;
|
||||
}
|
||||
|
||||
export function Overlay(props: OverlayProps) {
|
||||
export const Overlay: React.FC<OverlayProps> = props => {
|
||||
const {
|
||||
prefixCls,
|
||||
okButtonProps,
|
||||
@ -78,4 +78,4 @@ export function Overlay(props: OverlayProps) {
|
||||
)}
|
||||
</LocaleReceiver>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@ -77,7 +77,7 @@ const Popconfirm = React.forwardRef<unknown, PopconfirmProps>((props, ref) => {
|
||||
};
|
||||
|
||||
const onOpenChange = (value: boolean) => {
|
||||
const { disabled } = props;
|
||||
const { disabled = false } = props;
|
||||
if (disabled) {
|
||||
return;
|
||||
}
|
||||
@ -86,7 +86,10 @@ const Popconfirm = React.forwardRef<unknown, PopconfirmProps>((props, ref) => {
|
||||
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
placement,
|
||||
placement = 'top',
|
||||
trigger = 'click',
|
||||
okType = 'primary',
|
||||
icon = <ExclamationCircleFilled />,
|
||||
children,
|
||||
overlayClassName,
|
||||
...restProps
|
||||
@ -98,12 +101,17 @@ const Popconfirm = React.forwardRef<unknown, PopconfirmProps>((props, ref) => {
|
||||
return (
|
||||
<Popover
|
||||
{...restProps}
|
||||
trigger={trigger}
|
||||
prefixCls={prefixCls}
|
||||
placement={placement}
|
||||
onOpenChange={onOpenChange}
|
||||
open={open}
|
||||
ref={ref}
|
||||
overlayClassName={overlayClassNames}
|
||||
_overlay={
|
||||
<Overlay
|
||||
okType={okType}
|
||||
icon={icon}
|
||||
{...props}
|
||||
prefixCls={prefixCls}
|
||||
close={close}
|
||||
@ -111,8 +119,6 @@ const Popconfirm = React.forwardRef<unknown, PopconfirmProps>((props, ref) => {
|
||||
onCancel={onCancel}
|
||||
/>
|
||||
}
|
||||
overlayClassName={overlayClassNames}
|
||||
ref={ref as any}
|
||||
>
|
||||
{cloneElement(children, {
|
||||
onKeyDown: (e: React.KeyboardEvent<any>) => {
|
||||
@ -126,12 +132,4 @@ const Popconfirm = React.forwardRef<unknown, PopconfirmProps>((props, ref) => {
|
||||
);
|
||||
});
|
||||
|
||||
Popconfirm.defaultProps = {
|
||||
placement: 'top' as PopconfirmProps['placement'],
|
||||
trigger: 'click' as PopconfirmProps['trigger'],
|
||||
okType: 'primary' as PopconfirmProps['okType'],
|
||||
icon: <ExclamationCircleFilled />,
|
||||
disabled: false,
|
||||
};
|
||||
|
||||
export default Popconfirm;
|
||||
|
Loading…
Reference in New Issue
Block a user