From 724d87ea4095c336d0fc0ea6fd7144159f9bfb23 Mon Sep 17 00:00:00 2001
From: Dan Abramov Note:
-
React.PropTypes is deprecated as of React v15.5. Please use the prop-types library instead.React.PropTypes is deprecated as of React v15.5. Please use the prop-types library instead.
As your app grows, you can catch a lot of bugs with typechecking. For some applications, you can use JavaScript extensions like Flow or TypeScript to typecheck your whole application. But even if you don't use those, React has some built-in typechecking abilities. To run typechecking on the props for a component, you can assign the special propTypes property: