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.