Giter Club home page Giter Club logo

iteuljido's Issues

key 값은 고유한 값으로 쓰면 좋을거 같습니당

구현물보다가 뭔가 key가 인덱스인거같아서 코드 보니 key가 인덱스 값으로 쓰이고 있더라구요
리액트에서 key 값은 고유한 값이어야 하기때문에 index를 사용하기 보단, id 값을 사용하는게 좋을거 같아여

https://github.com/SoonGwan/ItEuljido/blob/4f35d622707beca6eee4ca4ab1ed923a150b95ad/src/container/NavContainer/NavContainer.tsx#L43-L54

왜 key가 고유한 값이어야 하는지는 리액트 재조정 단계를 읽어보면 이해할 수 있을겁니당

리액트 재조정 단계

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.