Skip to content

Commit 5b5bd77

Browse files
committed
chore: fix ts
1 parent 0b8304f commit 5b5bd77

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export type {
3232
BuildInPlacements,
3333
};
3434

35-
export { default as UniqueProvider } from './UniqueProvider';
35+
import UniqueProvider, { type UniqueProviderProps } from './UniqueProvider';
36+
37+
export { UniqueProvider, UniqueProviderProps };
3638

3739
export interface TriggerRef {
3840
nativeElement: HTMLElement;

tests/unique.test.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { cleanup, fireEvent, render } from '@testing-library/react';
22
import React from 'react';
3-
import Trigger, { UniqueProvider } from '../src';
3+
import Trigger, { UniqueProvider, type UniqueProviderProps } from '../src';
44
import { awaitFakeTimer } from './util';
55
import type { TriggerProps } from '../src';
66
import classNames from 'classnames';
@@ -257,9 +257,14 @@ describe('Trigger.Unique', () => {
257257
});
258258

259259
it('should apply postTriggerProps to customize options', async () => {
260-
const postTriggerProps = (options: any) => ({
260+
const postTriggerProps: UniqueProviderProps['postTriggerProps'] = (
261+
options,
262+
) => ({
261263
...options,
262-
popupClassName: classNames(options.popupClassName, 'custom-post-options-class'),
264+
popupClassName: classNames(
265+
options.popupClassName,
266+
'custom-post-options-class',
267+
),
263268
});
264269

265270
render(
@@ -276,6 +281,8 @@ describe('Trigger.Unique', () => {
276281
);
277282

278283
// Check that the custom class from postTriggerProps is applied
279-
expect(document.querySelector('.rc-trigger-popup')).toHaveClass('custom-post-options-class');
284+
expect(document.querySelector('.rc-trigger-popup')).toHaveClass(
285+
'custom-post-options-class',
286+
);
280287
});
281288
});

0 commit comments

Comments
 (0)