아래와 같이, useRouter를 통해,
post후, refresh를 하면, 데이터를 다시 가져올 수 있다.
import { useRouter } from "next/navigation"; const router = useRouter(); const addATodoHandler = async (title: string) => { if (newTodoInput.length < 1) { console.log("글자를 입력하세요"); return; } await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/todos`, { method: "post", body: JSON.stringify({ title: title, }), cache: "no-store", }); router.refresh(); // console.log(`할 일 추가 완료: ${newTodoInput}`); };