diff --git a/components/todos/todo-list.tsx b/components/todos/todo-list.tsx index 1cdfe0f..998ebac 100644 --- a/components/todos/todo-list.tsx +++ b/components/todos/todo-list.tsx @@ -42,15 +42,15 @@ interface TodoListProps { function QuickInput({ products, isDemo }: { products: Product[]; isDemo: boolean }) { const [state, formAction] = useActionState(createTodoAction, undefined) - const ref = useRef(null) + const titleRef = useRef(null) useEffect(() => { - if (state?.success) ref.current?.reset() + if (state?.success && titleRef.current) titleRef.current.value = '' }, [state]) return (
-
+