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

前端 未结 2 768
抹茶落季
抹茶落季 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条回答
  •  旧时难觅i
    2021-02-18 17:52

    render should return single root element https://jsfiddle.net/69z2wepo/41120/

    return (
    {commentNodes}
    );

    Update. More valid option using tbody as a wrapper

    return (
        {commentNodes}
    );
    

    https://jsfiddle.net/69z2wepo/41125/

提交回复
热议问题