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 Components (2018) React Component Patterns React Component Patterns Review

Brunhilde Vink
Brunhilde Vink
9,102 Points

Bummer! 'PropTypes' is incorrect

const Book = (props) => {
  return ( ... );
}

Book.PropTypes = {
 ...
};

1 Answer

Steven Parker
Steven Parker
231,007 Points

That's not the correct answer. Remember that identifiers in JavaScript are case-sensitive, so "PropTypes" is not the same thing as "propTypes".

Brunhilde Vink
Brunhilde Vink
9,102 Points

But we learned in the React course to use PropTypes instead of propTypes? I'm a bit confused because I indeed tried using propTypes in my latest projects but that gives me errors..

Steven Parker
Steven Parker
231,007 Points

Both identifiers are used, but for different things. You can see an example about 3 minutes into the Validate Props with PropTypes video on code lines 14 and 15.