mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-29 20:08:37 +08:00
13 lines
518 B
TypeScript
13 lines
518 B
TypeScript
import * as React from 'react';
|
|
import Trigger from 'rc-trigger/lib/mock';
|
|
import type { TriggerProps } from 'rc-trigger';
|
|
import { TriggerMockContext } from '../shared/demoTestContext';
|
|
|
|
const ForwardTrigger = React.forwardRef<any, TriggerProps>((props, ref) => {
|
|
const mergedPopupVisible = React.useContext(TriggerMockContext) ?? props.popupVisible;
|
|
(global as any).triggerProps = props;
|
|
return <Trigger {...props} ref={ref} popupVisible={mergedPopupVisible as boolean} />;
|
|
});
|
|
|
|
export default ForwardTrigger;
|