fix: checkbox ref type (#44746)

* fix: checkbox ref

* fix: Checkbox reference type test

* fix eslint warning
This commit is contained in:
Aleksei Mamaev 2023-09-12 06:38:40 +03:00 committed by GitHub
parent c9e94c26f6
commit 242769e0fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

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

View File

@ -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 */