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 hooks order execution when sorting #812

Merged
merged 1 commit into from
Jun 13, 2021
Merged

change hooks order execution when sorting #812

merged 1 commit into from
Jun 13, 2021

Conversation

lalogrosz
Copy link
Contributor

When you sort and you are in some page, the sort action reset the currentPage to 1 always.
Right now I don't want to add some logic to keep the currentPage, but I prefer to know first the sorting and then the changePage event, otherwise I don't know if the changePage is triggered by the pagination or by the sort.

Changing the useDidUpdateEffect order resolves this.

@codecov
Copy link

codecov bot commented May 26, 2021

Codecov Report

Merging #812 (6faf952) into next (61b1d3f) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next     #812   +/-   ##
=======================================
  Coverage   26.08%   26.08%           
=======================================
  Files          42       42           
  Lines         897      897           
  Branches      328      328           
=======================================
  Hits          234      234           
  Misses        659      659           
  Partials        4        4           
Impacted Files Coverage Δ
src/DataTable/DataTable.tsx 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61b1d3f...6faf952. Read the comment docs.

@jbetancur
Copy link
Owner

Thanks for the PR. Do you see any cases where this might break other functionality? Do you have an example of what this is resolving for you?

@lalogrosz
Copy link
Contributor Author

No, I didn't see any other scenario.

@jbetancur jbetancur merged commit 074a676 into jbetancur:next Jun 13, 2021
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