Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.
Frank Rousseau edited this page Apr 24, 2015 · 2 revisions

Good practice with React

Component's prototype validation

As your app grows it's helpful to ensure that your components are used correctly. We do this by allowing you to specify propTypes. React.PropTypes exports a range of validators that can be used to make sure the data you receive is valid. When an invalid value is provided for a prop, a warning will be shown in the JavaScript console. Note that for performance reasons propTypes is only checked in development mode.

Extracted from: https://facebook.github.io/react/docs/reusable-components.html#prop-validation

Clone this wiki locally