Skip to content

Commit

Permalink
Revert "fix: ref lost in Radio.Group (ant-design#25328)" (ant-design#…
Browse files Browse the repository at this point in the history
…26418)

This reverts commit 0a8641f.
  • Loading branch information
zombieJ committed Aug 26, 2020
1 parent 852fad9 commit a618000
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/radio/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ConfigContext } from '../config-provider';
import SizeContext from '../config-provider/SizeContext';
import { RadioGroupContextProvider } from './context';

const RadioGroup = React.forwardRef<unknown, RadioGroupProps>((props, ref) => {
const RadioGroup: React.FC<RadioGroupProps> = props => {
const { getPrefixCls, direction } = React.useContext(ConfigContext);
const size = React.useContext(SizeContext);

Expand Down Expand Up @@ -53,7 +53,6 @@ const RadioGroup = React.forwardRef<unknown, RadioGroupProps>((props, ref) => {
// 此处类型自动推导为 string
return (
<Radio
ref={ref}
key={option}
prefixCls={optionsPrefixCls}
disabled={disabled}
Expand All @@ -67,7 +66,6 @@ const RadioGroup = React.forwardRef<unknown, RadioGroupProps>((props, ref) => {
// 此处类型自动推导为 { label: string value: string }
return (
<Radio
ref={ref}
key={`radio-group-value-options-${option.value}`}
prefixCls={optionsPrefixCls}
disabled={option.disabled || disabled}
Expand Down Expand Up @@ -116,7 +114,7 @@ const RadioGroup = React.forwardRef<unknown, RadioGroupProps>((props, ref) => {
{renderGroup()}
</RadioGroupContextProvider>
);
});
};

RadioGroup.defaultProps = {
buttonStyle: 'outline' as RadioGroupButtonStyle,
Expand Down

0 comments on commit a618000

Please sign in to comment.