Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialCamila N
10,677 PointsWhy are we not using the key prop to identify the player, instead of passing the id prop?
In the Remove Items From State video from the React Basics course, we need to identify each player to remove them, and we're already passing the id attribute as a prop named key, in which we parse the id as a string. But, instead of using that, we're shown we need to add another prop, the id as an int, to deal with the removePlayer function. Why is this necessary? Can't we just use the key prop? Can't we parse it as an int when we're calling the function, if we really need to (which I don't see why we'd need to)?