Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript React Components Build Modular Interfaces With Components React Update

Ryli Davis
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Ryli Davis
Full Stack JavaScript Techdegree Graduate 14,884 Points

I'm having trouble understanding what you mean when you say "The handleRemovePlayer function looks at the previous...

I'm having trouble understanding what you mean when you say "The handleRemovePlayer function looks at the previous players and filters out the players that match the ID to the input. I'm having trouble also understanding what this line of code means and how it actually removes the player

( p => p.id !== id )

1 Answer

Laura Coronel
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Laura Coronel
Treehouse Teacher

Hey Ryli Davis, This video is mostly to show you how to update the React Basics project files to use React Hooks. I recommend checking out React Basics Remove Items from State video where Guil creates the handleRemovePlayer function. Guil walks you through the function and explains each line of code.

I hope this helps 😃