Current section: Rendering Arrays 59 exercises
Problem

Focus State

Loading exercise

Transcript

00:00 This step of the exercise is not so much an exercise in changing things as it much as it is Just let's explore the key prop a little bit further and what impact the key prop makes to not only The state of your input and components, but also like focus state and stuff like that

00:18 So and also a common mistake that people make is to just use the index like it You're you're mapping of an array and you get the item and then the second argument is the index and now you just use the index It's a key that's going to be unique, right? And no, you don't typically want to do that. There are situations where that can sort of make sense, but not normally

00:38 and so by using the index as a key, you're going to observe that it's actually operates the same as without a key and Then if you have a proper key than things work properly So I want you to focus on these different elements select some text start editing some text and see what the impact is on your

00:56 Experience and what you would kind of hope and expect would happen And yeah, just explore this a little bit. You don't have to make any code changes if you don't want to just explore this example I'll explore it with you here in a sec