Skip to content

Commit

Permalink
Closes #408 add missing TypeScript def
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsieurV committed Feb 16, 2022
1 parent 281d1a7 commit 1900475
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

- Removed support for depecrated `extraAriaContext` (please use `ariaLabelBuilder` instead)

## >= 8.1.1

- Add TypeScript definition for `pageLabelBuilder` prop

## >= 8.1.0

- A new prop `onClick` has been added. It is a callback for any click on the component. It exposes information on the part clicked (for eg. `isNext` for when next control is clicked or `isBreak` for a break clicked), the next expected page `nextSelectedPage` & others. Can return `false` to prevent any page change or a number to override the page to jump to. Just return nothing (or `undefined`) to let default behavior take place. (see: https://github.com/AdeleD/react-paginate/issues/263)
Expand Down
5 changes: 5 additions & 0 deletions index.d.ts
Expand Up @@ -142,6 +142,11 @@ export interface ReactPaginateProps {
*/
pageLinkClassName?: string | undefined;

/**
* Function to set the text on page links. Defaults to `(page) => page`
*/
pageLabelBuilder?(page: number): string | React.ReactNode;

/**
* The classname for the active page.
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "react-paginate",
"version": "8.1.0",
"version": "8.1.1",
"description": "A ReactJS component that creates a pagination.",
"main": "./dist/react-paginate.js",
"repository": {
Expand Down

0 comments on commit 1900475

Please sign in to comment.