score:2

Accepted answer

you don't need to map through the array. all you need to do is put this.props.data into the data field.

data={this.props.data}

then, as long as the keys i.e firstname, lastname etc... are in the objects, it shouldl print the table for you.

this is assuming your array looks like:

[{firstname: 'bob', lastname: 'sagget',...}, {firstname: 'george', lastname: 'bobbish',... }]

full return statement:

return(
        <div>
             <bootstraptable
              hover
              condensed={true}
              bootstrap4={true}
              keyfield='id'
              data={this.props.data}
              columns={columns}
              />
        </div>
    );

Related Query

More Query from same tag