refactor: clean up some deprecated APIs (#24881)

This commit is contained in:
二手掉包工程师 2020-06-10 11:12:31 +08:00 committed by GitHub
parent b2c359cb34
commit 57190f197b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -37,7 +37,7 @@ function isSelectOptionOrSelectOptGroup(child: any): Boolean {
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 childNodes: React.ReactElement[] = toArray(children);

View File

@ -46,7 +46,7 @@ export const ConfigConsumer = ConfigContext.Consumer;
// =========================== withConfigConsumer ===========================
// We need define many types here. So let's put in the block region
type IReactComponent<P = any> =
| React.StatelessComponent<P>
| React.FC<P>
| React.ComponentClass<P>
| React.ClassicComponentClass<P>;

View File

@ -15,7 +15,7 @@ export interface GroupProps {
compact?: boolean;
}
const Group: React.StatelessComponent<GroupProps> = props => (
const Group: React.FC<GroupProps> = props => (
<ConfigConsumer>
{({ getPrefixCls, direction }: ConfigConsumerProps) => {
const { prefixCls: customizePrefixCls, className = '' } = props;

View File

@ -21,7 +21,7 @@ interface ModalLocale {
justOkText: string;
}
const HookModal: React.RefForwardingComponent<HookModalRef, HookModalProps> = (
const HookModal: React.ForwardRefRenderFunction<HookModalRef, HookModalProps> = (
{ afterClose, config },
ref,
) => {

View File

@ -19,7 +19,7 @@ interface InternalTypographyProps extends TypographyProps {
setContentRef?: (node: HTMLElement) => void;
}
const Typography: React.RefForwardingComponent<{}, InternalTypographyProps> = (
const Typography: React.ForwardRefRenderFunction<{}, InternalTypographyProps> = (
{
prefixCls: customizePrefixCls,
component = 'article',