'A valid React element (or null) must be returned' error with one of the component in ReactJS

前端 未结 2 763
抹茶落季
抹茶落季 2021-02-18 17:13

My code is something like this

var data = [
    {id: 1, taskName: \"Pete Hunt\", standarDescription: \"This is one comment\", emplComment: \"meaaow I am meeawo\"         


        
2条回答
  •  余生分开走
    2021-02-18 17:41

    React component must have only one root node., as you are using TableforbasictaskList inside table you need wrap commentNodes in ., also inside Tableforbasictask move TableforbasictaskForm from table

    var TableforbasictaskList = React.createClass({
      render: function() {
        // .....
        return ({commentNodes});
      }
    });
    
    var Tableforbasictask = React.createClass({
      render: function() {
        return 
    Task Name Standard Discription of Task Employee Comment Employee rating
    } });

    Example

提交回复
热议问题