state-types-react
0.12.0 • Public • Published state-types-react
Allows for validating state in the same way as you would
with propTypes
or contextTypes
.
Use:
Require this module before React, at the top of your application.
require('state-types-react');
var Component = React.createClass({
stateTypes: {
account: React.PropTypes.instanceOf(Account).isRequired
},
getInitialState: function() {
account: getAccount()
},
render: function() {
return <Account name={this.state.account.name} />
}
});
License
MIT
/state-types-react/
//
Package Sidebar
Install
Weekly Downloads