Home > ISYS_ReactComponentizationDialogReactInstance
ISYS_ReactComponentizationDialogReactInstance 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 实例接口 用于接收扩展的 React 实例
Signature
interface ISYS_ReactComponentizationDialogReactInstanceRemarks
此接口定义了从扩展传递的 React 实例的方法。 由于扩展和 pro-api 使用不同的 React 实例,需要通过此接口传递 React 方法。
Example
const ReactInstance = {
createContext: React.createContext,
useContext: React.useContext,
useRef: React.useRef,
useEffect: React.useEffect,
createElement: React.createElement,
};2
3
4
5
6
7
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
<T>(defaultValue: T) => React.Context<T> | (ALPHA) 创建 React Context | ||
<P extends Record<string, unknown>>(type: React.ElementType<P>, props?: P | null, ...children: React.ReactNode[]) => React.ReactElement<P> | (ALPHA) 创建并返回指定类型的新 React 元素 | ||
<T>(context: React.Context<T>) => T | (ALPHA) 读取和订阅 Context 的值 | ||
(effect: () => undefined | (() => undefined), deps?: React.DependencyList) => void | (ALPHA) 执行副作用操作 | ||
<T>(initialValue: T) => React.MutableRefObject<T> | (ALPHA) 创建一个可变的 ref 对象 |