FAQ: PropTypes - Apply PropTypes

This community-built FAQ covers the “Apply PropTypes” exercise from the lesson “PropTypes”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn ReactJS: Part II

FAQs on the exercise Apply PropTypes

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Why is PropTypes in camel case when its called on the component? I was anticipating it being PropTypes like the import naming.

While I don’t have prior knowledge about propTypes, I think this is because the camel case propTypes is just the name chosen for the static method we define on the component class. It’s not yet using the imported library at this point, it’s just an arbitrary name for the method set to the object that will contain the propTypes, and as such it should be camel cased. Only the values of the proptypes added that object will actually use the PropTypes which then need to be capitalised.