Last active
September 13, 2018 08:33
-
-
Save cuonggt/cbadd47820b6535b8c1c05f5fb1b7ab3 to your computer and use it in GitHub Desktop.
Demo paginator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Paginator from './Paginator'; | |
class App extends Component { | |
state = { | |
currentPage: 1, | |
total: 686, | |
perPage: 10, | |
}; | |
handlePageChanged = (page) => { | |
this.setState({ | |
currentPage: page, | |
}); | |
// call request to refresh data | |
}; | |
render() { | |
const { | |
currentPage, total, perPage, | |
} = this.state; | |
return ( | |
<Paginator | |
currentPage={currentPage} | |
total={total} | |
perPage={perPage} | |
handlePageChanged={this.handlePageChanged} | |
/> | |
); | |
} | |
}; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment