ant-design/tests/__mocks__/rc-trigger.js
二货机器人 d422d71c1e
refactor: Drawer refactor (#36672)
* chore: back part of styl

* chore: all basic

* test: part test case

* test: part test case

* test: more test case

* test: update snapshot

* test: demo test support

* test: update snapshot

* chore: adjust mock logic to inject on rc-drawer instead

* test: more snapshot

* chore: adjust pos

* chore: back of render

* test: drawer demo extends test
2022-07-25 21:04:43 +08:00

9 lines
360 B
JavaScript

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} />;
});