File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -19,20 +19,20 @@ import { getAlignPopupClassName } from '../util';
19
19
export interface UniqueProviderProps {
20
20
children : React . ReactNode ;
21
21
/** Additional handle options data to do the customize info */
22
- postOptions ?: ( options : UniqueShowOptions ) => UniqueShowOptions ;
22
+ postTriggerProps ?: ( options : UniqueShowOptions ) => UniqueShowOptions ;
23
23
}
24
24
25
- const UniqueProvider = ( { children, postOptions } : UniqueProviderProps ) => {
25
+ const UniqueProvider = ( { children, postTriggerProps } : UniqueProviderProps ) => {
26
26
const [ trigger , open , options , onTargetVisibleChanged ] = useTargetState ( ) ;
27
27
28
28
// ========================== Options ===========================
29
29
const mergedOptions = React . useMemo ( ( ) => {
30
- if ( ! options || ! postOptions ) {
30
+ if ( ! options || ! postTriggerProps ) {
31
31
return options ;
32
32
}
33
33
34
- return postOptions ( options ) ;
35
- } , [ options , postOptions ] ) ;
34
+ return postTriggerProps ( options ) ;
35
+ } , [ options , postTriggerProps ] ) ;
36
36
37
37
// =========================== Popup ============================
38
38
const [ popupEle , setPopupEle ] = React . useState < HTMLDivElement > ( null ) ;
Original file line number Diff line number Diff line change @@ -256,14 +256,14 @@ describe('Trigger.Unique', () => {
256
256
expect ( computedStyle . getPropertyValue ( '--arrow-y' ) ) . not . toBe ( '' ) ;
257
257
} ) ;
258
258
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 ) => ( {
261
261
...options ,
262
262
popupClassName : classNames ( options . popupClassName , 'custom-post-options-class' ) ,
263
263
} ) ;
264
264
265
265
render (
266
- < UniqueProvider postOptions = { postOptions } >
266
+ < UniqueProvider postTriggerProps = { postTriggerProps } >
267
267
< Trigger
268
268
action = { [ 'click' ] }
269
269
popup = { < strong className = "x-content" > tooltip</ strong > }
@@ -275,7 +275,7 @@ describe('Trigger.Unique', () => {
275
275
</ UniqueProvider > ,
276
276
) ;
277
277
278
- // Check that the custom class from postOptions is applied
278
+ // Check that the custom class from postTriggerProps is applied
279
279
expect ( document . querySelector ( '.rc-trigger-popup' ) ) . toHaveClass ( 'custom-post-options-class' ) ;
280
280
} ) ;
281
281
} ) ;
You can’t perform that action at this time.
0 commit comments