From 33f70a6c4d34b839027da26afae4f910e8faa21a Mon Sep 17 00:00:00 2001 From: Peach Date: Fri, 24 Feb 2023 20:15:48 +0800 Subject: [PATCH] fix: dom type render failed bug in API component (#1507) --- examples/normal/src/Foo/index.tsx | 1 + src/client/theme-default/builtins/API/index.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/normal/src/Foo/index.tsx b/examples/normal/src/Foo/index.tsx index af75e2e31a..a98bad9848 100644 --- a/examples/normal/src/Foo/index.tsx +++ b/examples/normal/src/Foo/index.tsx @@ -23,6 +23,7 @@ const Foo: FC<{ onClick: (e?: MouseEvent) => void; children: React.ReactNode; onConfirm: (output: { children: any[] }) => void; + dom: HTMLElement; }> = (props) => { return <>{props.title}; }; diff --git a/src/client/theme-default/builtins/API/index.tsx b/src/client/theme-default/builtins/API/index.tsx index 54d8877597..e8b92ac5f0 100644 --- a/src/client/theme-default/builtins/API/index.tsx +++ b/src/client/theme-default/builtins/API/index.tsx @@ -78,7 +78,7 @@ const HANDLERS = { }, // FIXME: extract real type dom(prop: any) { - return `<${prop.$$__body.id} />`; + return prop.className || 'DOM'; }, // special handlers