I guess that the problem is - In editTodo function, you are calling getTodos() function. But, you are not updating the state with the response you get. See if this helps.

  const response = await fetch(
      method: "PUT",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(body)
  setTodo(await getTodos()); // Update the state with the values from fetch

Related Query

More Query from same tag