Created
November 5, 2014 00:30
-
-
Save marr/7da65c7b35aa551a43bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
'use strict'; | |
var Form = require('newforms'); | |
var React = require('react'); | |
module.exports = React.createClass({ | |
propTypes: { | |
form: React.PropTypes.object, | |
choices: React.PropTypes.array, | |
name: React.PropTypes.string | |
}, | |
getDefaultProps: function() { | |
return { | |
choices: [] | |
}; | |
}, | |
render: function() { | |
var field = new Form.ChoiceField(), | |
bf = new Form.BoundField({ | |
field: field, | |
form: this.props.form, | |
name: this.props.name | |
}); | |
return bf.render({ | |
attrs: { | |
choices: this.props.choices | |
} | |
}); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment