react-bootstrap-table / react-bootstrap-table2

Next Generation of react-bootstrap-table
https://react-bootstrap-table.github.io/react-bootstrap-table2/
MIT License
1.27k stars 431 forks source link

onPageChange is firing twice #1434

Open bymoe opened 4 years ago

bymoe commented 4 years ago

I am handling the current page with backend pagination, but the onPageChange is firing twice; the state is changing two time and it's breaking everything.

onPageChange: (page, sizePerPage) => {
console.log(page, sizePerPage);
},

Note that onSizePerPageChange is firing once and everything's working just fine.

react-bootstrap-table2-paginator version: 2.1.0 react-bootstrap-table-next: 3.3.5

bymoe commented 4 years ago

@AllenFang I appreciate your time If you can help me with this.

aguprado commented 4 years ago

you have to add the options remote onTableChange={() => {}} to the table properties.