DevTools/CodingStandards: Difference between revisions

Add link to more info about PropTypes
(Added content for React / Redux section)
(Add link to more info about PropTypes)
Line 157: Line 157:


=== PropTypes ===
=== PropTypes ===
* Use PropTypes to define the expected properties of your component. Each directly accessed property (or child of a property) should have a corresponding PropType.
* Use [https://facebook.github.io/react/docs/reusable-components.html#prop-validation PropTypes] to define the expected properties of your component. Each directly accessed property (or child of a property) should have a corresponding PropType.
* Use isRequired for any required properties.
* Use isRequired for any required properties.
* Place the propTypes definition at the top of the component. If using a stateless function component, place it above the declaration of the function.
* Place the propTypes definition at the top of the component. If using a stateless function component, place it above the declaration of the function.
* Where the children property is used, consider [http://www.mattzabriskie.com/blog/react-validating-children validating the children].
* Where the children property is used, consider [http://www.mattzabriskie.com/blog/react-validating-children validating the children].
3

edits