Type checking in React through the prop-types package ensures that you know what each variable stores even if documentation is lacking or not helpful. In this discourse, we examine prop types in depth to help you build a quality codebase.
Documenting components with React's PropTypes library is a great way to be notified when you've forgotten to pass a certain prop. Today we're going to see how we can leverage these to make our tests fail when our PropTypes are incorrect.
In my last post we talked about how to set default props value in our React components using the defaultProps property. In this post we will continue with the streak, we will see how to type the props argument.