score:25

Accepted answer

You cannot return multiple elements (like the array returned by the map function) from the render function. Also, you're missing a return statement. Try this:

var AnswerRows = React.createClass({
  componentDidMount: function() {
  },
  render: function() {
    return (
      <div>
        {this.props.answers.map(function(answer, i) {
          return (
            <div id="answerRow">
              <label className="AnswerText">
                <input type="checkbox" value={answer.id}  />
                {answer.text}
              </label>
            </div>
          );
        }, this)}
      </div>
    );
  }
});

Related Query

More Query from same tag