Skip to content

Commit 0b8304f

Browse files
committed
chore: rename
1 parent 720f5e6 commit 0b8304f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/UniqueProvider/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ import { getAlignPopupClassName } from '../util';
1919
export interface UniqueProviderProps {
2020
children: React.ReactNode;
2121
/** Additional handle options data to do the customize info */
22-
postOptions?: (options: UniqueShowOptions) => UniqueShowOptions;
22+
postTriggerProps?: (options: UniqueShowOptions) => UniqueShowOptions;
2323
}
2424

25-
const UniqueProvider = ({ children, postOptions }: UniqueProviderProps) => {
25+
const UniqueProvider = ({ children, postTriggerProps }: UniqueProviderProps) => {
2626
const [trigger, open, options, onTargetVisibleChanged] = useTargetState();
2727

2828
// ========================== Options ===========================
2929
const mergedOptions = React.useMemo(() => {
30-
if (!options || !postOptions) {
30+
if (!options || !postTriggerProps) {
3131
return options;
3232
}
3333

34-
return postOptions(options);
35-
}, [options, postOptions]);
34+
return postTriggerProps(options);
35+
}, [options, postTriggerProps]);
3636

3737
// =========================== Popup ============================
3838
const [popupEle, setPopupEle] = React.useState<HTMLDivElement>(null);

tests/unique.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ describe('Trigger.Unique', () => {
256256
expect(computedStyle.getPropertyValue('--arrow-y')).not.toBe('');
257257
});
258258

259-
it('should apply postOptions to customize options', async () => {
260-
const postOptions = (options: any) => ({
259+
it('should apply postTriggerProps to customize options', async () => {
260+
const postTriggerProps = (options: any) => ({
261261
...options,
262262
popupClassName: classNames(options.popupClassName, 'custom-post-options-class'),
263263
});
264264

265265
render(
266-
<UniqueProvider postOptions={postOptions}>
266+
<UniqueProvider postTriggerProps={postTriggerProps}>
267267
<Trigger
268268
action={['click']}
269269
popup={<strong className="x-content">tooltip</strong>}
@@ -275,7 +275,7 @@ describe('Trigger.Unique', () => {
275275
</UniqueProvider>,
276276
);
277277

278-
// Check that the custom class from postOptions is applied
278+
// Check that the custom class from postTriggerProps is applied
279279
expect(document.querySelector('.rc-trigger-popup')).toHaveClass('custom-post-options-class');
280280
});
281281
});

0 commit comments

Comments
 (0)