Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change activePage but Paga not change #150

Open
amen160 opened this issue Apr 25, 2023 · 0 comments
Open

Change activePage but Paga not change #150

amen160 opened this issue Apr 25, 2023 · 0 comments

Comments

@amen160
Copy link

amen160 commented Apr 25, 2023

Please help me. When I change activePage but Paga not change

import React, { Component } from 'react';
import Pagination from 'react-js-pagination';

class MyComponent extends Component {
constructor(props) {
super(props);
this.state = {
activePage: 1
};
this.handlePageChange = this.handlePageChange.bind(this);
}

handlePageChange(pageNumber) {
this.setState({ activePage: pageNumber });
}

goToNextPage() {
const newActivePage = this.state.activePage + 1;
this.handlePageChange(newActivePage);
}

render() {
return (



<button onClick={() => this.goToNextPage()}>Next page

);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant