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 Basics (retired) Thinking in Components PropTypes and DefaultProps

propTypes vs PropTypes

In the video, the instructor mentioned that we should take note the capitalization differences in propType/PropTypes in the following code:

Application.propTypes = {
  title: React.PropTypes.string;
}

; however, he doesn't explain the nuance (unless I missed it). Is it because the lowercase (propTypes) is a property of Application and the uppercase (PropTypes) is an object within a module named React?

Any insight would be greatly appreciated!

1 Answer

I found this explanation in the teachers notes. React.PropTypes exports a range of validators that can be used to make sure the data you receive is valid.