---
title: "Comment by Gemma Black on \"Conditional Rendering and Rendering List in React\" | Hashnode"
description: "Good to know: In React, we use the index of an element as a key attribute. But this is an anti-pattern. We shouldn’t do this"
url: "https://hashnode.com/posts/conditional-rendering-and-rendering-list-in-react/645471be4ccaa07fc976e5a3/comment/645472b5f475a1092cbd7e3b"
---

[Discussion](https://hashnode.com/posts/conditional-rendering-and-rendering-list-in-react/645471be4ccaa07fc976e5a3)

Comment [Conditional Rendering and Rendering List in React](https://hashnode.com/posts/conditional-rendering-and-rendering-list-in-react/645471be4ccaa07fc976e5a3)

[Gemma Black](https://hashnode.com/@GemmaBlack)

[May 5, 2023](https://hashnode.com/posts/conditional-rendering-and-rendering-list-in-react/645471be4ccaa07fc976e5a3/comment/645472b5f475a1092cbd7e3b)

Good to know:

> In React, we use the index of an element as a key attribute. But this is an anti-pattern. We shouldn’t do this

[Debajit Mallick](https://hashnode.com/@debajit13)

[May 5, 2023](https://hashnode.com/posts/conditional-rendering-and-rendering-list-in-react/645471be4ccaa07fc976e5a3/comment/645472b5f475a1092cbd7e3b#reply-64548d53f475a1092cbd8166)

Thanks [Gemma Black](https://hashnode.com/@GemmaBlack), Yes, this does a lot of unnecessary re-renders.
