Here is the code
trying to compile it says "Argument of type 'toDo' is not assignable to parameter of type 'SetStateAction<toDo[]>'"
i cannot figure out how it is not working since the type seem to be correct.
How to avoid that error
const [todoList, setTodoList] = useState<toDo[]>([])
useEffect(() => {
loadToDoList()
}, [])
const loadToDoList = async () => {
const toDoList = await ToDoService.getToDoList()
console.log(toDoList)
setTodoList(toDoList)
}
return (
<div>
<ToDoList items={todoList} />
</div>
)
}```