Load props es mejor al inicio de render
This commit is contained in:
@@ -85,8 +85,6 @@ export default class Paginate extends Component {
|
||||
* {...x} => represents page neighbours
|
||||
*/
|
||||
fetchPageNumbers() {
|
||||
this.loadProps();
|
||||
|
||||
const totalPages = this.totalPages;
|
||||
const currentPage = this.state.currentPage;
|
||||
const pageNeighbours = this.pageNeighbours;
|
||||
@@ -135,6 +133,8 @@ export default class Paginate extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
this.loadProps();
|
||||
|
||||
if (!this.totalRecords || this.totalPages === 1) return null;
|
||||
|
||||
const currentPage = this.state.currentPage;
|
||||
|
||||
Reference in New Issue
Block a user