Conversation
Summary of ChangesHello, 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를 사용하여 새로운 프로젝트를 초기 설정하고, 코드 일관성을 위한 ESLint 및 Prettier를 구성합니다. 또한, 로컬 스토리지를 통해 데이터를 영구적으로 저장하는 기본적인 투두(Todo) 애플리케이션을 구현하여 사용자가 할 일을 추가, 수정, 삭제할 수 있도록 합니다. Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
풀 리퀘스트를 검토한 결과, 몇 가지 중요한 개선 사항이 발견되었습니다. 특히 README.md 파일에 병합 충돌 마커가 남아 있어 즉시 해결해야 합니다. 또한, 투두 항목의 데이터 구조와 상태 관리 로직이 TodoApp.jsx와 useTodos.js 파일 간에 일관성이 없으며, TodoItem.jsx 컴포넌트가 정의되었음에도 불구하고 사용되지 않고 있습니다. 이러한 문제들은 코드의 일관성, 재사용성 및 잠재적인 런타임 오류를 야기할 수 있으므로 해결하는 것이 좋습니다.
| <<<<<<< HEAD | ||
| # React + Vite | ||
|
|
||
| This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
|
|
||
| Currently, two official plugins are available: | ||
|
|
||
| - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) | ||
| - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) | ||
|
|
||
| ## React Compiler | ||
|
|
||
| The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). | ||
|
|
||
| ## Expanding the ESLint configuration | ||
|
|
||
| If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project. | ||
| ======= | ||
| # 리액트 투두 앱 만들기 미션 레포 | ||
| >>>>>>> upstream/main |
src/components/TodoItem.jsx
Outdated
| @@ -0,0 +1,21 @@ | |||
| import { useTodoContext } from '../context/TodoContext' | |||
| const [todos, setTodos] = useState([]) | ||
| const [input, setInput] = useState('') | ||
| const [editId, setEditId] = useState(null) |
src/components/TodoItem.jsx
Outdated
| textDecoration: todo.completed ? 'line-through' : 'none', | ||
| }} | ||
| > | ||
| {todo.value} |
| {todos.map((todo, index) => ( | ||
| <li key={todo.id}> | ||
| {index + 1}. {todo.text} | ||
| <button onClick={() => editTodo(todo)}>수정</button> | ||
| <button onClick={() => deleteTodo(todo.id)}>삭제</button> | ||
| </li> |
src/hooks/useTodos.js
Outdated
| id: Date.now().toString(), | ||
| value: input, | ||
| completed: false, | ||
| } |
src/components/TodoApp.jsx
Outdated
| setTodos(todos.map((todo) => (todo.id === editId ? { ...todo, text: input } : todo))) | ||
| setEditId(null) | ||
| } else { | ||
| setTodos([...todos, { id: Date.now(), text: input }]) |
There was a problem hiding this comment.
| reactRefresh.configs.vite, | ||
| ], | ||
| languageOptions: { | ||
| ecmaVersion: 2020, |
There was a problem hiding this comment.
| export default function TodoApp() { | ||
| const [todos, setTodos] = useState([]) | ||
| const [input, setInput] = useState('') | ||
| const [editId, setEditId] = useState(null) |
There was a problem hiding this comment.
id: Date.now()로 개채 무결성 보장하셨는데 19번쨰 줄에 방어 로직은 어떤 이유가 있을까요?
src/components/TodoApp.jsx
Outdated
| setTodos(todos.map((todo) => (todo.id === editId ? { ...todo, text: input } : todo))) | ||
| setEditId(null) | ||
| } else { | ||
| setTodos([...todos, { id: Date.now(), text: input, completed: false }]) |
There was a problem hiding this comment.
Date.now()니까 19번쨰 줄의 방어로직은 없어도 될거같아용.
There was a problem hiding this comment.
방어로직 지우고 실행해보니 잘 되는걸 확인했습니다 리뷰 감사합니다!
|
항목 수정 부분과 조건부 렌더링을 활용해 완료 상태의 데이터의 변화가 즉각적으로 UI에 반영되는 요소를 잘 활용하신 것 같아요!! |
Uh oh!
There was an error while loading. Please reload this page.