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 trial

JavaScript React by Example Building the Application Toggling Edit State for Guests

Typo in the video

In the GuestList.js file, the prop name Guil wrote is handeToggleEditing instead of handleToggleEditing, although it doesn't matter now because it has been passed the way it is (Thanks to VS Code IntelliSense 😛).

Just want to aware if someone runs into this issue.

1 Answer

Lee Vaughn
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Lee Vaughn
Treehouse Teacher

Good eye Zaid Khan!

Your code may be different since it sounds like you spotted and fixed the typo on your end but the reason that Guil's code in the video and the code in the provided files works is because the name (handeToggleEditing) is the same in both the GuestList and Guest components. So even though the name might not look correct as far as spelling goes, all the code cares about is that the names are the same in the different places where it is referenced. If it would have been handeToggleEditing in the GuestList component and handleToggleEditing in the Guest component then it would have caused and error but since the names are the same it works as is.

As you touched on, this is one example of how a good text editor can help you when it comes to things like auto-completion. Even if you make a "mistake" as long as you are consistent things will often still work.

Thanks, Lee, This typo wouldn't have come to light if I not have watched the video dozens of times since I ran into my own typo.