August 2017
Beginner
298 pages
7h 4m
English
Whenever we are passing props to our React components, it is recommended to do proptype validation. A proptype validation is a simple type checking that happens in the development builds of React, which is used to check whether all the props are supplied properly to our React component. If not, it will display a warning message, which is very helpful for debugging.
All types of props that can be passed to our React component are defined in the 'prop-types' package, which gets installed along with create-react-app. You can see that I have included the following import statement at the top of the file:
import PropTypes from 'prop-types';
To do proptype validation for our App component, inside the App class, add the following ...
Read now
Unlock full access