Browse Source

refactor: clean up some deprecated APIs (#24881)

pull/24895/head
二手掉包工程师 5 years ago
committed by GitHub
parent
commit
57190f197b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/auto-complete/index.tsx
  2. 2
      components/config-provider/context.tsx
  3. 2
      components/input/Group.tsx
  4. 2
      components/modal/useModal/HookModal.tsx
  5. 2
      components/typography/Typography.tsx

2
components/auto-complete/index.tsx

@ -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);

2
components/config-provider/context.tsx

@ -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>;

2
components/input/Group.tsx

@ -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;

2
components/modal/useModal/HookModal.tsx

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

2
components/typography/Typography.tsx

@ -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',

Loading…
Cancel
Save