diff --git a/examples/todo/src/main.tsx b/examples/todo/src/main.tsx index 1f59790..f56d587 100644 --- a/examples/todo/src/main.tsx +++ b/examples/todo/src/main.tsx @@ -1,9 +1,9 @@ -import { createState, upsert, useEffect } from "@idealjs/sapling"; +import { createProxy, createRef, upsert, useEffect } from "@idealjs/sapling"; const TodoItem = (props: { name: number; count: number }) => { let { name, count } = props; - const state = createState(0); - const ref = createState(null); + const state = createProxy({ val: 0 }); + const ref = createRef(null); useEffect(() => { const handler = setInterval(() => { state.val++; @@ -25,7 +25,7 @@ const TodoItem = (props: { name: number; count: number }) => {