Comments (5)
저는 src/modules/todos.js 파일에서 TOGGLE과 REMOVE 이렇게 수정했습니다.
from learning-react.
@produck
그 방법도 있지만 findIndex를 통해 모든 원소를 순회하는 로직입니다.
애초에 state와 list의 index를 일치해주는 것이 바람직해보입니다.
from learning-react.
id와 index를 일치시킬 방법은 없지 않나요?
리스트 중간의 항목을 삭제하면 해당 아이템 이후 index가 전부 -1 되버리니 매번 id를 갱신해 줄 수 있는 것도 아니라고 봅니다.
from learning-react.
@produck
뭐 방법은 여러가지 있겠지만은
https://github.com/unilep/Todo-list
이건 제가 id자체를 없애고 수정한겁니다.
사실 여기선 todo에 id가의미가 없어서요.
from learning-react.
음..!! 정말 심각한 오류네요
왜 이런 실수를 저질렀지 :0 부끄럽군요..
위 커밋에서 수정되었습니다 :)
from learning-react.
Related Issues (20)
- p327 Module not found: Error: Can't resolve './serviceWorker HOT 1
- 24.3 헤더 컴포넌트 만들기 중 withRouter 내용 수정해주셨으면 좋겠습니다! HOT 1
- [20.3.4] 서버를 실행하고 localhost:5000에 접근하면 'React is not defined' 오류가 발생합니다. HOT 2
- 25 quill 이슈 HOT 1
- 23.6 자바스크립트 문법 문의
- 20.3.4 Error: A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.
- 25.3.3 질문 HOT 1
- [9.4] styled-components에서 colon expected HOT 1
- p. 72~73 className을 사용하는 방법에 대한 질문입니다.
- 개정판> 24장) <Route path="/@:username"> HOT 3
- 20.4 데이터 로딩 에서 token'<' 에러 발생
- 20.5 hydrate 적용 시 에러 발생 문의드립니다.
- 24장 회원가입시 문제가 생길경우 하나의 solution
- node_modules 오류? HOT 2
- [개정판] 데이터 베이스 연결 에러 HOT 1
- Ch27.1.2 수정버튼클릭시 글쓰기 페이지로 이동 - 에디터에 제목, 태그가 나타나지 않습니다
- Chapter 22 이후 mongoose import 이슈
- Chapter 24 /@:username 이슈
- 20.4.3 UsersContainer.js 코드 중 오탈자 문의
- Chapter20 - ServerSideRendering with redux-saga
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learning-react.