diff --git a/src/checkbox/Checkbox.tsx b/src/checkbox/Checkbox.tsx index 031a4217..1047523a 100644 --- a/src/checkbox/Checkbox.tsx +++ b/src/checkbox/Checkbox.tsx @@ -29,7 +29,7 @@ export interface CheckContextValue { export const CheckContext = React.createContext(null); -const Checkbox = forwardRef((_props: CheckBoxProps) => { +const Checkbox = forwardRef((_props, ref) => { const context = useContext(CheckContext); const props = useDefaultProps(context ? context.inject(_props) : _props, checkboxDefaultProps); const { classPrefix } = useConfig(); @@ -167,22 +167,20 @@ const Checkbox = forwardRef((_props: CheckBoxProps) => { ); return ( - <> -
- {icon && renderIconNode()} - {renderCheckBoxContent()} - {/* 下边框 */} - {!borderless && ( -
- )} -
- +
+ {icon && renderIconNode()} + {renderCheckBoxContent()} + {/* 下边框 */} + {!borderless && ( +
+ )} +
); }); Checkbox.displayName = 'Checkbox'; export default forwardRefWithStatics( - (props: TdCheckboxProps, ref: Ref) => , + (props: TdCheckboxProps, ref: Ref) => , { Group: CheckboxGroup }, );