From a6ff1b3ff53532614111f8d61277cf33f3bc79c6 Mon Sep 17 00:00:00 2001 From: Yuta Sakurai Date: Mon, 30 Jun 2025 16:20:49 +0900 Subject: [PATCH] =?UTF-8?q?Step2:=20TODO=E8=BF=BD=E5=8A=A0,=E4=B8=80?= =?UTF-8?q?=E8=A6=A7=E8=A1=A8=E7=A4=BA=E7=94=BB=E9=9D=A2=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.tsx | 66 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 3d7512a..b247867 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,13 +1,73 @@ +"use client"; + +import { useState } from "react"; + +// Todo型の定義 +type Todo = { + id: number; + text: string; + completed: boolean; +}; + export default function Home() { + // 状態管理の準備(サンプルデータ付き) + const [todos, setTodos] = useState([ + { id: 1, text: "TypeScriptを学ぶ", completed: false }, + { id: 2, text: "Reactの基礎を理解する", completed: true }, + { id: 3, text: "TODOアプリを作る", completed: false }, + ]); + return (

私のTODOアプリ

-

- これからTODOアプリを作っていきます! -

+ + {/* TODO入力フォーム */} +
+
+ + +
+
+ + {/* TODOリスト表示エリア */} +
+ {todos.map((todo) => ( +
+ + + {todo.text} + + +
+ ))} +
);