Wednesday, 7 June 2017

Cannot read property 'map' of undefined in react datatable error

getting Error in map function.

 generateRows: function() {
    var cols = this.props.cols,  // [{key, label}]
        data = this.props.data;

Getting error in data (undefined value getting)

    return data.map(function(item) {

        // handle the column data within each row
        var cells = cols.map(function(colData) {
            // colData.key might be "firstName"
            return <td> {item[colData.key]} </td>;
        });
        return <tr key={item.BlogId}> {cells} </tr>;
    });
},



via Nidhi Tiwari

No comments:

Post a Comment