mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
refactor: clean up some deprecated APIs (#24881)
This commit is contained in:
parent
b2c359cb34
commit
57190f197b
@ -37,7 +37,7 @@ function isSelectOptionOrSelectOptGroup(child: any): Boolean {
|
|||||||
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
|
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
const AutoComplete: React.RefForwardingComponent<Select, AutoCompleteProps> = (props, ref) => {
|
const AutoComplete: React.ForwardRefRenderFunction<Select, AutoCompleteProps> = (props, ref) => {
|
||||||
const { prefixCls: customizePrefixCls, className, children, dataSource } = props;
|
const { prefixCls: customizePrefixCls, className, children, dataSource } = props;
|
||||||
const childNodes: React.ReactElement[] = toArray(children);
|
const childNodes: React.ReactElement[] = toArray(children);
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ export const ConfigConsumer = ConfigContext.Consumer;
|
|||||||
// =========================== withConfigConsumer ===========================
|
// =========================== withConfigConsumer ===========================
|
||||||
// We need define many types here. So let's put in the block region
|
// We need define many types here. So let's put in the block region
|
||||||
type IReactComponent<P = any> =
|
type IReactComponent<P = any> =
|
||||||
| React.StatelessComponent<P>
|
| React.FC<P>
|
||||||
| React.ComponentClass<P>
|
| React.ComponentClass<P>
|
||||||
| React.ClassicComponentClass<P>;
|
| React.ClassicComponentClass<P>;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ export interface GroupProps {
|
|||||||
compact?: boolean;
|
compact?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Group: React.StatelessComponent<GroupProps> = props => (
|
const Group: React.FC<GroupProps> = props => (
|
||||||
<ConfigConsumer>
|
<ConfigConsumer>
|
||||||
{({ getPrefixCls, direction }: ConfigConsumerProps) => {
|
{({ getPrefixCls, direction }: ConfigConsumerProps) => {
|
||||||
const { prefixCls: customizePrefixCls, className = '' } = props;
|
const { prefixCls: customizePrefixCls, className = '' } = props;
|
||||||
|
@ -21,7 +21,7 @@ interface ModalLocale {
|
|||||||
justOkText: string;
|
justOkText: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const HookModal: React.RefForwardingComponent<HookModalRef, HookModalProps> = (
|
const HookModal: React.ForwardRefRenderFunction<HookModalRef, HookModalProps> = (
|
||||||
{ afterClose, config },
|
{ afterClose, config },
|
||||||
ref,
|
ref,
|
||||||
) => {
|
) => {
|
||||||
|
@ -19,7 +19,7 @@ interface InternalTypographyProps extends TypographyProps {
|
|||||||
setContentRef?: (node: HTMLElement) => void;
|
setContentRef?: (node: HTMLElement) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Typography: React.RefForwardingComponent<{}, InternalTypographyProps> = (
|
const Typography: React.ForwardRefRenderFunction<{}, InternalTypographyProps> = (
|
||||||
{
|
{
|
||||||
prefixCls: customizePrefixCls,
|
prefixCls: customizePrefixCls,
|
||||||
component = 'article',
|
component = 'article',
|
||||||
|
Loading…
Reference in New Issue
Block a user