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
|
* {...x} => represents page neighbours
|
||||||
*/
|
*/
|
||||||
fetchPageNumbers() {
|
fetchPageNumbers() {
|
||||||
this.loadProps();
|
|
||||||
|
|
||||||
const totalPages = this.totalPages;
|
const totalPages = this.totalPages;
|
||||||
const currentPage = this.state.currentPage;
|
const currentPage = this.state.currentPage;
|
||||||
const pageNeighbours = this.pageNeighbours;
|
const pageNeighbours = this.pageNeighbours;
|
||||||
@@ -135,6 +133,8 @@ export default class Paginate extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
this.loadProps();
|
||||||
|
|
||||||
if (!this.totalRecords || this.totalPages === 1) return null;
|
if (!this.totalRecords || this.totalPages === 1) return null;
|
||||||
|
|
||||||
const currentPage = this.state.currentPage;
|
const currentPage = this.state.currentPage;
|
||||||
|
|||||||
Reference in New Issue
Block a user