Reputation: 153
<Pagination
count={pageCount}
color="primary"
onChange={() => props.onPageChange()}
/>
I am trying to send the current page number to onChange.
Upvotes: 5
Views: 11551
Reputation: 4394
You should use it like this:
onChange={props.onPageChange}
and the onChange function should look like this:
onPageChange = (event, value)
Value parameter is the number of your current page that is exposed as an argument of this function by the Pagination component itself. See this code sendbox: https://codesandbox.io/s/bn7nw?file=/demo.js
Upvotes: 8