defaultProps and propTypes are static elements of React components, they are not changed for each instance. See https://facebook.imtqy.com/react/docs/reusable-components.html
One example of static properties is the ability to track how many instances of an object have been created (and not for a specific answer). Note that most of the time, static methods are the smell of code if you change state.
var Contacts = React.createClass({ statics: { instanceCount: 0 }, getInitialState: function() { Contacts.instanceCount++ return {}; }, render: function() { return (<div > Hello { this.props.name } < /div>); } }); console.log(Contacts.instanceCount)
Another example is a method for storing constants.
var Contacts = React.createClass({ statics: { MAX_VALUE:100 }, render: function() { return (<div > Hello { this.props.name } < /div>); } }); if (someValue > Contacts.MAX_VALUE) { }
source share