I am using react-bootstrap-table2 pagination in my react application.I am using a state to update the sizePerPage dynamically.But it is not working. When I console the state, I am able to see the change, but it is not updating the pagination.
Here is my code:
const [sizePerPage,setSizePerPage] = useState(10);
const pagination = paginationFactory({
page:1,
sizePerPage:sizePerPage,
.......
onPageChange:function(page,sizePerPage),
onSizePerPageChange:function(page,sizePerPage)
});
Here I am changing the state:
<select onChange={e=>setSizePerPage(e.target.value)}>
<option value={10}>10</option>
<option value={25}>25</option>
<option value={50}>50</option>
</select>
Rest of the things are working fine.