DEV Community

loading...

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

Collapse
spacer33 profile image
spacer33

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)

Collapse
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. 😁