DefinitelyTyped/types/react-js-pagination/react-js-pagination-tests.tsx
Ernesto 64407a18dd React js pagination (#27022)
* Add type definitions for react-js-pagination

* Add tslint file and remove import statement from index.ts

* Fix tslint errors

* Enable noImplicitThis and strictNullChecks in tsconfig
2018-07-03 09:36:34 -07:00

25 lines
567 B
TypeScript

import * as React from 'react';
import Pagination from 'react-js-pagination';
class ReactPagination extends React.Component<{}, {activePage: number}> {
constructor(props: {}) {
super(props);
this.state = {
activePage: 1
};
this.handleChange = this.handleChange.bind(this);
}
handleChange(pageNumber: number) {
this.setState({
activePage: pageNumber
});
}
render() {
return (
<Pagination activePage={this.state.activePage} onChange={this.handleChange}
totalItemsCount={100}
/>
);
}
}