Validate Props With PropTypes7:16 with Laura Coronel
As your app grows, it's a good practice to "type check" or validate the data a component receives from props. In this video, you'll learn how to validate props with the PropTypes library. PropTypes not only help you catch and avoid bugs, they also serve as a documentation for components. Other developers working on the same project will know exactly which props your components take, and what types they should be.
If you have npm version 5 or greater you can install prop-types with
npm i prop-types. To check what npm version you have enter
npm -v in the terminal.
You need to sign up for Treehouse in order to download course files.Sign up