From c60dec9d9a7caca32d69a8a47c42ee671ba59fbe Mon Sep 17 00:00:00 2001 From: Daniel Cortes Date: Wed, 3 Jun 2020 21:29:12 -0400 Subject: [PATCH] Load props es mejor al inicio de render --- src/components/Paginate.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Paginate.jsx b/src/components/Paginate.jsx index b49a4ec..456766b 100644 --- a/src/components/Paginate.jsx +++ b/src/components/Paginate.jsx @@ -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;