React code throwing “TypeError: this.props.data.map is not a function”

Modify the code to this:

loadStatusFromServer: function() {
    return $.ajax({
        url: this.props.url,
        dataType: 'json',
        success: function(data) {
            this.setState({data: data})
        }.bind(this),

Here dataType: 'json', is important. See $.ajax() docs and related questions on SO:

Leave a Comment