mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-23 18:50:06 +08:00
Merge branch 'master' into wuxh/fix-51166
This commit is contained in:
commit
598ccfb558
@ -1,7 +1,6 @@
|
||||
---
|
||||
order: 6
|
||||
title: Changelog
|
||||
toc: false
|
||||
timeline: true
|
||||
tag: vVERSION
|
||||
---
|
||||
|
@ -2,6 +2,7 @@ import * as React from 'react';
|
||||
import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
|
||||
import classNames from 'classnames';
|
||||
import RcSwitch from 'rc-switch';
|
||||
import type { SwitchChangeEventHandler, SwitchClickEventHandler } from 'rc-switch';
|
||||
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
||||
|
||||
import Wave from '../_util/wave';
|
||||
@ -11,11 +12,7 @@ import useSize from '../config-provider/hooks/useSize';
|
||||
import useStyle from './style';
|
||||
|
||||
export type SwitchSize = 'small' | 'default';
|
||||
export type SwitchChangeEventHandler = (
|
||||
checked: boolean,
|
||||
event: React.MouseEvent<HTMLButtonElement>,
|
||||
) => void;
|
||||
export type SwitchClickEventHandler = SwitchChangeEventHandler;
|
||||
export type { SwitchChangeEventHandler, SwitchClickEventHandler };
|
||||
|
||||
export interface SwitchProps {
|
||||
prefixCls?: string;
|
||||
@ -110,11 +107,10 @@ const InternalSwitch = React.forwardRef<HTMLButtonElement, SwitchProps>((props,
|
||||
|
||||
return wrapCSSVar(
|
||||
<Wave component="Switch">
|
||||
{/* @ts-ignore */}
|
||||
<RcSwitch
|
||||
{...restProps}
|
||||
checked={checked}
|
||||
onChange={changeHandler as any}
|
||||
onChange={changeHandler}
|
||||
prefixCls={prefixCls}
|
||||
className={classes}
|
||||
style={mergedStyle}
|
||||
|
Loading…
Reference in New Issue
Block a user