react-bootstrap-table2-paginator not working.
See original GitHub issueHello,
I get the below error when I try to add pagination functionality to the bootstrap table. Here’s what I have -
import * as React from 'react';
import { Component } from 'react';
import BootstrapTable from "react-bootstrap-table-next";
import paginationFactory from 'react-bootstrap-table2-paginator';
export class Queues extends Component<{}, IQueueState> {
constructor() {
super({});
this.state = {
queues: [{
"id": "1",
"name": "Book",
"price": "18"
},
{
"id": "2",
"name": "Mobile",
"price": "400"
}], loading: true
};
}
public render() {
const columns = [
{
dataField: 'id',
text: 'Product ID'
},
{
dataField: 'name',
text: 'Product Name'
}, {
dataField: 'price',
text: 'Product Price'
}
];
return <div>
<h2>With Pagination </h2>
<BootstrapTable keyField='id'
data={this.state.queues}
columns={columns}
pagination={paginationFactory()} />
</div>;
}
And the dependencies that I have currently -
"react": "^16.4.1",
"react-bootstrap-table-next": "^0.1.12",
"react-bootstrap-table2-paginator": "^0.1.4",
"react-dom": "^16.4.1"
Without pagination property the table renders properly but I get the below error when I add paginator -
Uncaught Error: n.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
at e.exports (vendor.js?v=gWN0dwqp0_yY627VZPL5GJPbGaLm6i9oU_upMHr2BP4:1)
at l._renderValidatedComponent (vendor.js?v=gWN0dwqp0_yY627VZPL5GJPbGaLm6i9oU_upMHr2BP4:58)
at l.performInitialMount (vendor.js?v=gWN0dwqp0_yY627VZPL5GJPbGaLm6i9oU_upMHr2BP4:58)
Any help here is much appreciated!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Pagination not working in react-bootstrap-table2
I am using react-bootstrap-table2-paginator for adding Pagination to my BootstrapTable. I get the below error when I add the Pagination part ...
Read more >react-bootstrap-table2-paginator - npm
Start using react-bootstrap-table2-paginator in your project by running `npm i react-bootstrap-table2-paginator`.
Read more >react-bootstrap-table2-paginator examples - CodeSandbox
Learn how to use react-bootstrap-table2-paginator by viewing and forking example apps that make use of react-bootstrap-table2-paginator on CodeSandbox. ...
Read more >Remote Table · react-bootstrap-table2 - GitHub Pages
In the remote pagination, react-bootstrap-table2 doesn't know all the data, only have the data on current page. So that's why you need to...
Read more >Setup React Table Pagination | React Bootstrap Table2
Setup React Table Pagination | React BootstrapWhats up y'all in this video I will teach y'all how to how setup pagination for your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I had the same issue, I installed React and React-Dom in their 16.4.1 version and updated dependencies and all worked:
@Genarito updating dependencies worked like a charm Thanks for the fix appreciate it.