Skip to content

Commit 576569c

Browse files
updated createElements to support all kinds of elements including math and svg
1 parent 4037260 commit 576569c

File tree

10 files changed

+2822
-323
lines changed

10 files changed

+2822
-323
lines changed

src/components/App.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ const App = (props: any) => {
1414
// return <Test />;
1515
return (
1616
<>
17-
<button onClick={() => visible.update((prev) => !prev)}>
17+
<button
18+
style={{ margin: 10 }}
19+
onClick={() => visible.update((prev) => !prev)}
20+
>
1821
Show/Hide
1922
</button>
20-
{() => (visible.value ? <Users /> : "Hidden")}
23+
{() => (visible.value ? <Test /> : "Hidden")}
2124
</>
2225
);
2326
// return <StylesTest />;

src/components/Test.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Test = () => {
2121
};
2222
});
2323

24-
const h1ref = createRef<HTMLHeadingElement>();
24+
const h1ref = createRef();
2525
// console.log("hello");
2626
return (
2727
<div>
@@ -30,6 +30,20 @@ const Test = () => {
3030
<>{() => textSignal.value}</>
3131
</h1>
3232

33+
<svg
34+
width="100"
35+
height="100"
36+
>
37+
<circle
38+
cx="50"
39+
cy="50"
40+
r="40"
41+
stroke="green"
42+
stroke-width="4"
43+
fill="yellow"
44+
/>
45+
</svg>
46+
3347
{/* {() =>
3448
showTextSignal.value ? (
3549
<LazyFC2

src/index.d.ts

Lines changed: 0 additions & 190 deletions
This file was deleted.

0 commit comments

Comments
 (0)