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

fix(types/pagination) #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nickzoum
Copy link

@nickzoum nickzoum commented Aug 22, 2023

Added the declarations for the functions to the "state and getters" object in the following lines

  // src/pagination/usePagination.ts
  const stateAndGetters = {
    ...state,
    getTotalPages,
    getPages,
    getPageBoundaries,
  };

So that you can get full type support when doing pagination.state.getPages(data.nodes).map(...).

Add the declarations for the functions added to the "state and getters" object in the following lines

https://github.com/table-library/react-table-library/blob/3b0ddab82cf7c633731087ba9534020ec9099db2/src/pagination/usePagination.ts#L136C1-L141C5

  // src/pagination/usePagination.ts
  const stateAndGetters = {
    ...state,
    getTotalPages,
    getPages,
    getPageBoundaries,
  };
@GOussama
Copy link

When using the sort feature
I have this error.

image

Any one have the same problem
Thank you

@nickzoum
Copy link
Author

nickzoum commented Oct 25, 2023

@GOussama I'm not a project contributor, I just added a suggested change to fix a type issue I was having.
Did your error happen after applying the suggested change? If not, then I don't think this is relevant to this PR and you should instead address the product owners.

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

Successfully merging this pull request may close these issues.

None yet

2 participants