diff --git a/packages/react-antd-materials/package.json b/packages/react-antd-materials/package.json index 54d57785f..65b93c095 100644 --- a/packages/react-antd-materials/package.json +++ b/packages/react-antd-materials/package.json @@ -1,6 +1,6 @@ { "name": "@rxdrag/react-antd-materials", - "version": "0.6.1", + "version": "0.6.2", "module": "index.ts", "files": [ "dist" diff --git a/packages/react-antd-materials/src/materials/datas/Table/designer/index.tsx b/packages/react-antd-materials/src/materials/datas/Table/designer/index.tsx index ab5e848c8..142487bf2 100644 --- a/packages/react-antd-materials/src/materials/datas/Table/designer/index.tsx +++ b/packages/react-antd-materials/src/materials/datas/Table/designer/index.tsx @@ -2,9 +2,9 @@ import { IFieldMeta } from "@rxdrag/fieldy"; import { TableProps } from "@rxdrag/react-antd-components"; import { useNode, useTreeNodes, ComponentDesignerView } from "@rxdrag/react-core"; import { Table } from "antd"; -import { forwardRef, memo, useMemo } from "react" +import { Ref, forwardRef, memo, useMemo } from "react" -export const TableDesigner = memo(forwardRef(( +export const TableDesigner = memo(forwardRef(( props: TableProps, ref ) => { @@ -43,6 +43,7 @@ export const TableDesigner = memo(forwardRef(( return ( { const handleRef = useCallback((element: HTMLElement | undefined) => { for (const key of Object.keys(node?.rxProps || {})) { if (isHTMLElement(element) && !locked) { + console.log("===> handleRef", node?.meta?.componentName, element) element?.setAttribute(key, (node?.rxProps as any)[key]) } } diff --git a/packages/rxeditor/react-core/src/hocs/types.ts b/packages/rxeditor/react-core/src/hocs/types.ts index 1f5cf1dd8..ea4ff9d86 100644 --- a/packages/rxeditor/react-core/src/hocs/types.ts +++ b/packages/rxeditor/react-core/src/hocs/types.ts @@ -1,4 +1,4 @@ //antd组件的ref,有时候不是HTMLElement -export type Callback = (element?: HTMLElement | unknown) => HTMLElement | unknown; -export const defaultCallback = (element?: HTMLElement | unknown): HTMLElement | unknown => element || null; +export type Callback = (element?: HTMLElement | null) => HTMLElement | null | undefined; +export const defaultCallback = (element?: HTMLElement | null): HTMLElement | null | undefined => element ;