DEV Community


Discussion on: How I think when I write a React component. 🤔

spacer33 profile image

Nice example!

Just one thing, using index as a key is not a good practice, field is also unique, so better use it as a key (+one less variable)

potouridisio profile image
Ioannis Potouridis Author

I agree, good point!

Since the example uses fields that are presented as user input with no unique identifiers though, I felt safer using the index. 😁