Git Product home page Git Product logo

Comments (5)

kimpeupeu avatar kimpeupeu commented on July 26, 2024

image

저는 src/modules/todos.js 파일에서 TOGGLE과 REMOVE 이렇게 수정했습니다.

from learning-react.

unilep avatar unilep commented on July 26, 2024

@produck
그 방법도 있지만 findIndex를 통해 모든 원소를 순회하는 로직입니다.

애초에 state와 list의 index를 일치해주는 것이 바람직해보입니다.

from learning-react.

kimpeupeu avatar kimpeupeu commented on July 26, 2024

id와 index를 일치시킬 방법은 없지 않나요?
리스트 중간의 항목을 삭제하면 해당 아이템 이후 index가 전부 -1 되버리니 매번 id를 갱신해 줄 수 있는 것도 아니라고 봅니다.

from learning-react.

unilep avatar unilep commented on July 26, 2024

@produck
뭐 방법은 여러가지 있겠지만은
https://github.com/unilep/Todo-list
이건 제가 id자체를 없애고 수정한겁니다.

사실 여기선 todo에 id가의미가 없어서요.

from learning-react.

velopert avatar velopert commented on July 26, 2024

음..!! 정말 심각한 오류네요
왜 이런 실수를 저질렀지 :0 부끄럽군요..

a3ada1e

위 커밋에서 수정되었습니다 :)

from learning-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.