サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
iPhone 16
robinpokorny.com
So many times I have seen developers use the index of an item as its key when they render a list. { todos.map((todo, index) => <Todo {...todo} key={index} />); } It looks elegant and it does get rid of the warning (which was the ‘real’ issue, right?). What is the danger here? It may break your application and display wrong data! Let me explain, a key is the only thing React uses to identify DOM el
このページを最初にブックマークしてみませんか?
『robinpokorny.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く