Skip to content

Instantly share code, notes, and snippets.

@marr
Created November 5, 2014 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marr/7da65c7b35aa551a43bb to your computer and use it in GitHub Desktop.
Save marr/7da65c7b35aa551a43bb to your computer and use it in GitHub Desktop.
/** @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