From d178eee50a39803eede05835f955f471f162a20f Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Mon, 17 Jul 2023 12:40:52 +0800 Subject: [PATCH] type: replace any type with CheckboxRef (#43599) --- components/radio/{context.tsx => context.ts} | 0 components/radio/{index.tsx => index.ts} | 0 components/radio/{interface.tsx => interface.ts} | 0 components/radio/radioButton.tsx | 9 +++++---- 4 files changed, 5 insertions(+), 4 deletions(-) rename components/radio/{context.tsx => context.ts} (100%) rename components/radio/{index.tsx => index.ts} (100%) rename components/radio/{interface.tsx => interface.ts} (100%) diff --git a/components/radio/context.tsx b/components/radio/context.ts similarity index 100% rename from components/radio/context.tsx rename to components/radio/context.ts diff --git a/components/radio/index.tsx b/components/radio/index.ts similarity index 100% rename from components/radio/index.tsx rename to components/radio/index.ts diff --git a/components/radio/interface.tsx b/components/radio/interface.ts similarity index 100% rename from components/radio/interface.tsx rename to components/radio/interface.ts diff --git a/components/radio/radioButton.tsx b/components/radio/radioButton.tsx index 1cdf3b6a94..2a42c95840 100644 --- a/components/radio/radioButton.tsx +++ b/components/radio/radioButton.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import type { CheckboxRef } from '../checkbox'; import type { AbstractCheckboxProps } from '../checkbox/Checkbox'; import { ConfigContext } from '../config-provider'; import { RadioOptionTypeContextProvider } from './context'; @@ -7,17 +8,17 @@ import Radio from './radio'; export type RadioButtonProps = AbstractCheckboxProps; -const RadioButton = (props: RadioButtonProps, ref: React.Ref) => { +const RadioButton: React.ForwardRefRenderFunction = (props, ref) => { const { getPrefixCls } = React.useContext(ConfigContext); const { prefixCls: customizePrefixCls, ...radioProps } = props; const prefixCls = getPrefixCls('radio', customizePrefixCls); return ( - - + + ); }; -export default React.forwardRef(RadioButton); +export default React.forwardRef(RadioButton);