Skip to content

Commit

Permalink
fix activeClass problem
Browse files Browse the repository at this point in the history
  • Loading branch information
GHarutyunyan committed Jun 19, 2020
1 parent df7a56c commit 566d9f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-laravel-paginex",
"version": "2.0.6",
"version": "2.0.8",
"description": "Laravel Pagination with ReactJS (customizable)",
"main": "dist/index.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/Pagination.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class Pagination extends Component {

// Check if page is active
isCurrent = (page) => {
return this.state.paginationData.current_page === page;
let currentPage = this.state.paginationData.meta ? this.state.paginationData.meta.current_page : this.state.paginationData.current_page;
return currentPage === page;
};

// Handle pagination buttons click event
Expand Down Expand Up @@ -185,4 +186,4 @@ Pagination.propTypes = {
}),
data: PropTypes.object
};
export default Pagination;
export default Pagination;

0 comments on commit 566d9f0

Please sign in to comment.