Skip to content

Latest commit

 

History

History
222 lines (112 loc) · 4.09 KB

File metadata and controls

222 lines (112 loc) · 4.09 KB

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_ReactComponentizationDialogReactInstance 

Remarks

此接口定义了从扩展传递的 React 实例的方法。 由于扩展和 pro-api 使用不同的 React 实例,需要通过此接口传递 React 方法。

Example

const ReactInstance = {
  createContext: React.createContext,
  useContext: React.useContext,
  useRef: React.useRef,
  useEffect: React.useEffect,
  createElement: React.createElement,
};

Properties

Property

Modifiers

Type

Description

createContext

<T>(defaultValue: T) => React.Context<T>

(ALPHA) 创建 React Context

createElement

<P extends Record<string, unknown>>(type: React.ElementType<P>, props?: P | null, ...children: React.ReactNode[]) => React.ReactElement<P>

(ALPHA) 创建并返回指定类型的新 React 元素

useContext

<T>(context: React.Context<T>) => T

(ALPHA) 读取和订阅 Context 的值

useEffect

(effect: () => undefined | (() => undefined), deps?: React.DependencyList) => void

(ALPHA) 执行副作用操作

useRef

<T>(initialValue: T) => React.MutableRefObject<T>

(ALPHA) 创建一个可变的 ref 对象


属性详情

createcontext

ISYS_ReactComponentizationDialogReactInstance.createContext property

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 Context

Signature

createContext: <T>(defaultValue: T) => React.Context<T>;

createelement

ISYS_ReactComponentizationDialogReactInstance.createElement property

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

createElement: <P extends Record<string, unknown>>(type: React.ElementType<P>, props?: P | null, ...children: React.ReactNode[]) => React.ReactElement<P>;

usecontext

ISYS_ReactComponentizationDialogReactInstance.useContext property

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.

读取和订阅 Context 的值

Signature

useContext: <T>(context: React.Context<T>) => T;

useeffect

ISYS_ReactComponentizationDialogReactInstance.useEffect property

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.

执行副作用操作

Signature

useEffect: (effect: () => undefined | (() => undefined), deps?: React.DependencyList) => void;

useref

ISYS_ReactComponentizationDialogReactInstance.useRef property

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.

创建一个可变的 ref 对象

Signature

useRef: <T>(initialValue: T) => React.MutableRefObject<T>;