Skip to content

Instantly share code, notes, and snippets.

@maisonm
Last active January 22, 2020 16:08
Show Gist options
  • Save maisonm/b3cc73bc8cad4341b1706ce41baea8ae to your computer and use it in GitHub Desktop.
Save maisonm/b3cc73bc8cad4341b1706ce41baea8ae to your computer and use it in GitHub Desktop.
moveOnePageForward = () => {
const { dataStartingIndex, totalPages, currentClickedNumber } = this.state;
if (dataStartingIndex) {
this.setState({
dataStartingIndex: null,
currentClickedNumber: 2
});
} else {
this.setState({
currentClickedNumber:
currentClickedNumber + 1 > totalPages
? totalPages
: currentClickedNumber + 1
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment