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

[RFR] Convert PaginationActions to hooks #3598

Merged
merged 7 commits into from
Aug 27, 2019

Conversation

jaytula
Copy link
Contributor

@jaytula jaytula commented Aug 25, 2019

Convert PaginationActions to hooks.

This was mostly straightforward conversion done step-by-step (running make test-unit at every step). One note though... I removed the HOC recompose/pure along with the non-default export. Using the pure-wrapped component does not pass the PaginationActions.spec. Let me know if I got this wrong.

);

export default enhance(PaginationActions);
export default PaginationActions;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should wrap this component with React.memo (basically the same as pure)

);

export default enhance(PaginationActions);
export default React.memo(PaginationActions, () => true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're preventing this component to rerender when its props change. Please don't override the isEqual function (that's what pure does).

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@djhi djhi added this to the 3.0.0 milestone Aug 27, 2019
@djhi djhi merged commit 2044887 into marmelab:next Aug 27, 2019
@jaytula jaytula deleted the usestyles-paginationactions branch August 28, 2019 15:11
import ChevronLeft from '@material-ui/icons/ChevronLeft';
import ChevronRight from '@material-ui/icons/ChevronRight';
import compose from 'recompose/compose';
import { translate } from 'ra-core';
import { useTranslate } from 'react-admin';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ra-core

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.

3 participants