mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
fix: checkbox ref type (#44746)
* fix: checkbox ref * fix: Checkbox reference type test * fix eslint warning
This commit is contained in:
parent
c9e94c26f6
commit
242769e0fb
@ -1,10 +1,11 @@
|
||||
import * as React from 'react';
|
||||
import Checkbox from '..';
|
||||
import type { CheckboxRef } from '..';
|
||||
import Input from '../../input';
|
||||
|
||||
describe('Checkbox.typescript', () => {
|
||||
it('Checkbox', () => {
|
||||
const ref = React.createRef<HTMLInputElement>();
|
||||
const ref = React.createRef<CheckboxRef>();
|
||||
const checkbox = <Checkbox value ref={ref} />;
|
||||
|
||||
expect(checkbox).toBeTruthy();
|
||||
|
@ -1,14 +1,15 @@
|
||||
import type * as React from 'react';
|
||||
import type { CheckboxRef } from 'rc-checkbox';
|
||||
import type { CheckboxProps } from './Checkbox';
|
||||
import InternalCheckbox from './Checkbox';
|
||||
import Group from './Group';
|
||||
|
||||
export type { CheckboxRef } from 'rc-checkbox';
|
||||
export type { CheckboxChangeEvent, CheckboxProps } from './Checkbox';
|
||||
export type { CheckboxGroupProps, CheckboxOptionType } from './Group';
|
||||
export type { CheckboxRef };
|
||||
|
||||
type CompoundedComponent = React.ForwardRefExoticComponent<
|
||||
CheckboxProps & React.RefAttributes<HTMLInputElement>
|
||||
CheckboxProps & React.RefAttributes<CheckboxRef>
|
||||
> & {
|
||||
Group: typeof Group;
|
||||
/** @internal */
|
||||
|
Loading…
Reference in New Issue
Block a user