(await loader()).default}
/>
);
-}
diff --git a/source/decorator.ts b/source/decorator.tsx
similarity index 87%
rename from source/decorator.ts
rename to source/decorator.tsx
index 2876671..2287662 100644
--- a/source/decorator.ts
+++ b/source/decorator.tsx
@@ -1,4 +1,4 @@
-import { DataObject, DOMRenderer, JsxChildren, VNode } from 'dom-renderer';
+import { DataObject, JsxChildren, VNode } from 'dom-renderer';
import {
autorun,
IReactionDisposer,
@@ -13,6 +13,7 @@ import {
toHyphenCase
} from 'web-utility';
+import { AsyncCell } from './Async';
import { getMobxData } from './utility';
import { ClassComponent } from './WebCell';
@@ -22,32 +23,9 @@ export type PropsWithChildren = P & {
export type FunctionComponent
= (props: P) => VNode;
export type FC
= FunctionComponent
;
-function wrapFunction
(func: FC
) {
- const renderer = new DOMRenderer();
-
- return (props: P) => {
- let tree = func(props),
- root: Node;
-
- if (!VNode.isFragment(tree)) {
- const disposer = autorun(() => {
- tree = func(props);
-
- if (tree && root) renderer.patch(VNode.fromDOM(root), tree);
- });
- const { ref } = tree;
-
- tree.ref = node => {
- if (node) root = node;
- else disposer();
-
- ref?.(node);
- };
- }
-
- return tree;
- };
-}
+const wrapFunction =
+
(func: FC
) =>
+ (props: P) => ;
interface ReactionItem {
expression: ReactionExpression;
diff --git a/tsconfig.json b/tsconfig.json
index 2c764c9..7871df7 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -20,6 +20,15 @@
"excludePrivate": true,
"readme": "./ReadMe.md",
"plugin": ["typedoc-plugin-mdn-links"],
+ "highlightLanguages": [
+ "html",
+ "css",
+ "json",
+ "js",
+ "tsx",
+ "shell",
+ "diff"
+ ],
"customCss": "./guide/table.css"
}
}