ant-design/tests/__mocks__/rc-trigger.js

9 lines
360 B
JavaScript
Raw Normal View History

import * as React from 'react';
import Trigger from 'rc-trigger/lib/mock';
import { TriggerMockContext } from '../shared/demoTestContext';
export default React.forwardRef((props, ref) => {
const mergedPopupVisible = React.useContext(TriggerMockContext) ?? props.popupVisible;
return <Trigger {...props} ref={ref} popupVisible={mergedPopupVisible} />;
});