I have installed "react-bootstrap-table2" via npm and I have write a sample code for table but when I run this code and getting an error message in browser console as
Uncaught TypeError: Cannot read property 'filter' of undefined at new BootstrapTableContainer (index.js:96)
import React, { Component } from 'react';
import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';
import BootstrapTable from 'react-bootstrap-table-next';
class UserList extends Component {
constructor(props) {
super(props);
const products = [];
const columns = [{
dataField: 'id',
text: 'Product ID'
}, {
dataField: 'name',
text: 'Product Name'
}, {
dataField: 'price',
text: 'Product Price'
}];
}
render() {
return (
<div>
<BootstrapTable
keyField='id'
data={this.products}
columns={this.columns}
/>
</div>
);
}
}
export default UserList;