Skip to content

[AIBE6/2팀/임현호] TODO APP 만들기 완료#43

Open
predevho wants to merge 11 commits intosik2:mainfrom
predevho:main
Open

[AIBE6/2팀/임현호] TODO APP 만들기 완료#43
predevho wants to merge 11 commits intosik2:mainfrom
predevho:main

Conversation

@predevho
Copy link

@predevho predevho commented Mar 17, 2026

✅ React Todo App

todo_app_component_structure (1)


📌 프로젝트 소개

React의 핵심 개념인 컴포넌트 분리, Custom Hook, 상태 관리(useState/useRef) 를 직접 구현해보는 Todo 앱입니다.
할 일 추가 / 완료 토글 / 삭제 기능을 갖추고 있으며, 관심사 분리 원칙에 따라 로직과 UI를 구분하여 작성했습니다.


🛠 기술 스택

구분 사용 기술
프레임워크 React 18
빌드 도구 Vite
언어 JavaScript (JSX)
상태 관리 useState, useRef (Custom Hook)

⚙️ 구현 기능

  • ✅ 할 일 추가 — 입력 후 등록 버튼 또는 Enter 키
  • ✅ 할 일 완료 토글 — 체크박스 클릭으로 완료/미완료 전환
  • ✅ 할 일 삭제 — 항목별 삭제 버튼
  • ✅ 빈 입력 유효성 검사 — 공백 입력 시 경고 알림
  • ✅ 최신 항목이 목록 상단에 표시

🗂 컴포넌트 구조

src/
├── App.jsx                  # 루트 컴포넌트 — 상태·핸들러 배분
├── hooks/
│   └── useTodos.js          # Custom Hook — 상태 및 비즈니스 로직
└── components/
    ├── TodoWriteForm.jsx     # 할 일 입력 폼
    ├── TodoList.jsx          # 할 일 목록 렌더링
    └── TodoItem.jsx          # 개별 할 일 아이템

데이터 흐름

useTodos (Custom Hook)
    ↓ todos, addTodo, toggleTodo, removeTodo
  App.jsx
    ├─→ TodoWriteForm  (addTodo)
    └─→ TodoList       (todos, toggleTodo, removeTodo)
              └─→ TodoItem × N
컴포넌트 역할
useTodos todos 상태 및 CRUD 로직 관리
App Hook에서 받은 상태·함수를 하위 컴포넌트에 전달
TodoWriteForm 폼 제출 이벤트 처리 및 addTodo 호출
TodoList 배열을 순회하며 TodoItem 렌더링
TodoItem 체크박스·삭제 버튼 UI 및 이벤트 처리

🚀 테일윈드

직접 작성하는데 어려움을 느껴서 claude에 도움을 받아 작성함
before

after

@predevho predevho changed the title 기본틀 [AIBE6/2팀/임현호] TODO APP 만들기 진행중 Mar 17, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 React + Vite 기반의 새로운 Todo 앱 프로젝트의 기본 구조를 설정합니다. ESLint와 Prettier를 설정하여 코드 품질과 스타일을 관리하고, 불필요한 파일이 저장소에 포함되지 않도록 .gitignore를 설정했습니다. 초기 개발 환경을 구축하여 효율적인 React 개발을 위한 기반을 마련했습니다.

Highlights

  • 기본 React 앱 설정: Vite를 사용하여 React 개발 환경의 기본 틀을 설정했습니다.
  • ESLint 구성 추가: 코드 품질 유지를 위해 ESLint를 구성하고 React 관련 규칙을 추가했습니다.
  • Prettier 설정 추가: 코드 스타일 일관성을 위해 Prettier를 설정했습니다.
  • .gitignore 설정: 프로젝트에 불필요한 파일들이 저장소에 포함되지 않도록 .gitignore 파일을 설정했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • node_modules, dist, logs 등 불필요한 파일 및 폴더를 제외하도록 설정했습니다.
  • .prettierrc
    • 코드 포맷팅 규칙을 설정하여 코드 스타일 일관성을 유지하도록 했습니다.
  • README.md
    • 프로젝트에 대한 기본 정보를 업데이트했습니다.
  • eslint.config.js
    • ESLint 구성 파일을 추가하고 React 규칙을 포함했습니다.
  • index.html
    • React 앱을 위한 기본 HTML 파일을 추가했습니다.
  • package-lock.json
    • 프로젝트 종속성 잠금 파일을 추가했습니다.
  • package.json
    • 프로젝트 기본 정보 및 스크립트, 종속성을 정의했습니다.
  • public/favicon.svg
    • 기본 favicon을 추가했습니다.
  • public/icons.svg
    • 프로젝트에서 사용할 아이콘을 추가했습니다.
  • src/App.jsx
    • 기본적인 Todo 앱 컴포넌트를 구현했습니다.
  • src/assets/react.svg
    • React 로고를 추가했습니다.
  • src/assets/vite.svg
    • Vite 로고를 추가했습니다.
  • src/main.jsx
    • React 앱의 진입점을 설정했습니다.
  • vite.config.js
    • Vite 빌드 구성을 설정하고 React 플러그인을 추가했습니다.
Activity
  • 새 프로젝트 기본 틀 설정
  • ESLint, Prettier 설정 추가
  • .gitignore 설정 완료
  • React + Vite 기반 개발 환경 구축
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

안녕하세요. TODO 앱 구현을 위한 초기 설정 및 기본 기능 추가 PR을 리뷰했습니다.

전반적으로 Vite와 React를 사용한 프로젝트 초기 구성이 잘 이루어졌습니다. App.jsx 컴포넌트에서 todo 항목의 상태 관리 방식과 key 사용에 대한 개선점을 발견하여 코멘트를 남겼습니다. 각 todo 항목에 고유한 ID를 부여하여 상태를 관리하면 애플리케이션의 안정성과 확장성을 높일 수 있습니다. 제안드린 내용을 확인 부탁드립니다.

Comment on lines +3 to +30
function App() {
const [todos, setTodos] = useState(['할 일 1', '할 일 2', '할 일 3'])

const handleOnSubmit = (e) => {
e.preventDefault()
const form = e.target
setTodos([form.todo.value, ...todos])
}
const removeTodo = (selectedTodo) => {
const filterTodos = todos.filter((todo, index) => index != selectedTodo)
setTodos(filterTodos)
}
return (
<>
<form onSubmit={handleOnSubmit}>
<input type="text" name="todo" placeholder="TO DO" />
<button type="submit">등록</button>
</form>
<ul>
{todos.map((todo, index) => (
<li key={index}>
{todo} <button onClick={() => removeTodo(index)}>X</button>
</li>
))}
</ul>
</>
)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

현재 todos 상태는 문자열 배열로 관리되고 있으며, map 함수에서 indexkey로 사용하고 있습니다. 이는 React에서 안티패턴으로 알려져 있으며, 항목이 추가, 삭제, 또는 재정렬될 때 예기치 않은 동작을 유발할 수 있습니다.

todo 항목이 고유한 ID를 갖도록 상태 구조를 변경하는 것이 좋습니다. 이렇게 하면 안정적인 key를 제공할 수 있고, 상태 관리도 더 용이해집니다.

아래와 같이 수정하는 것을 제안합니다:

  • todos 상태를 { id: number, text: string } 형태의 객체 배열로 변경합니다.
  • 새로운 todo를 추가할 때 고유 ID를 생성합니다. (예: 카운터 상태 사용)
  • todo를 삭제할 때 index 대신 id를 사용합니다.
  • map 함수에서 key prop으로 todo.id를 사용합니다.
  • todo 추가 후 입력 필드를 초기화하여 사용자 경험을 개선합니다.
  • todo가 추가되지 않도록 입력값 유효성 검사를 추가합니다.
function App() {
    const [todos, setTodos] = useState([
        { id: 1, text: '할 일 1' },
        { id: 2, text: '할 일 2' },
        { id: 3, text: '할 일 3' },
    ])
    const [nextId, setNextId] = useState(4)

    const handleOnSubmit = (e) => {
        e.preventDefault()
        const form = e.target
        const text = form.todo.value.trim()
        if (!text) {
            return
        }
        setTodos([{ id: nextId, text }, ...todos])
        setNextId(nextId + 1)
        form.reset()
    }

    const removeTodo = (idToRemove) => {
        setTodos(todos.filter((todo) => todo.id !== idToRemove))
    }
    return (
        <>
            <form onSubmit={handleOnSubmit}>
                <input type="text" name="todo" placeholder="TO DO" />
                <button type="submit">등록</button>
            </form>
            <ul>
                {todos.map((todo) => (
                    <li key={todo.id}>
                        {todo.text} <button onClick={() => removeTodo(todo.id)}>X</button>
                    </li>
                ))}
            </ul>
        </>
    )
}

@predevho predevho changed the title [AIBE6/2팀/임현호] TODO APP 만들기 진행중 [AIBE6/2팀/임현호] TODO APP 만들기 완료 Mar 19, 2026
Copy link

@hoehoeabi hoehoeabi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다

@p7548296-afk
Copy link

README에 기능 설명과 구조 개요 설명이 잘 되어 있어서 이해하기 좋았다고 생각합니다!

@ktk33762
Copy link

기존 코드도 안보시고, Copilot도 없이 만드셨다고 들었는데 기본 기능에 충실하고, 컴포넌트 분리까지 너무 잘 만들어주신 것 같습니다!
이번 프로젝트 고생 많으셨습니다!

@yunabin
Copy link

yunabin commented Mar 20, 2026

깔끔하게 잘 구현하신 것 같습니다! 미완료된 데이터가 직관적으로 잘 보여서 좋은 것 같습니다 ㅎㅎ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants