Home > ISYS_ReactComponentizationDialogInterface
ISYS_ReactComponentizationDialogInterface interface
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
React 组件化弹出窗口接口
Signature
typescript
interface ISYS_ReactComponentizationDialogInterface1
Remarks
此接口提供了创建 React 组件化弹出窗口所需的所有功能。 通过此接口,用户可以使用 lc-editor-design 提供的预制组件创建自定义弹窗。
Example
typescript
const { Components, WorkerPortal, VirtualRender } = await eda.sys_Dialog.createReactComponentizationDialogInterface(
{
createContext: React.createContext,
useContext: React.useContext,
useRef: React.useRef,
useEffect: React.useEffect,
createElement: React.createElement,
},
{
default: Reconciler,
constants: {
ContinuousEventPriority,
DiscreteEventPriority,
DefaultEventPriority,
ConcurrentRoot,
},
},
);
const portal = new WorkerPortal();
const root = new VirtualRender();
function MyDialog() {
return (
<Modal defaultTop={100} defaultLeft={100} defaultWidth={800} defaultHeight={600}>
<Dialog title="My Dialog">
<Input placeholder="Enter text" />
</Dialog>
</Modal>
);
}
root.render(
<portal.Provider>
<MyDialog />
</portal.Provider>,
);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
(ALPHA) 预制组件 | |||
typeof LC_DESIGN_COMPONENTS_NAMES | (ALPHA) 组件名称常量 | ||
(ALPHA) VirtualRender 类 | |||
(ALPHA) WorkerPortal 类 |