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] Fix Datagrid can't handle dynamic children #3635

Merged
merged 7 commits into from
Oct 15, 2019

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Sep 2, 2019

Fixes #3631 and #3629

@djhi djhi added this to the 3.0.0 milestone Sep 2, 2019
@djhi djhi requested a review from fzaninotto September 2, 2019 08:54
Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

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

As discussed with @djhi, the use of memo here is useless as the children prop will change at every render. Therefore, the performance is not really good. We must add an optimized flag allowing to turn on speed optimizations when the columns of the datagrid don't change.

@djhi
Copy link
Collaborator Author

djhi commented Oct 7, 2019

@fzaninotto I just tried this branch again with a CPU throttle set to x6 and I haven't notice any performance issues nor differences with the version without this fix. Can you try again ?

@djhi djhi changed the title [RFR] Fix Datagrid can't handle dynamic children [WIP] Fix Datagrid can't handle dynamic children Oct 7, 2019
@djhi djhi changed the title [WIP] Fix Datagrid can't handle dynamic children [RFR] Fix Datagrid can't handle dynamic children Oct 8, 2019
@@ -91,7 +82,11 @@ DatagridBody.defaultProps = {
row: <DatagridRow />,
};

const MemoDatagridBody = memo(DatagridBody);
Copy link
Member

Choose a reason for hiding this comment

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

memo doesn't work here as children will always change

@djhi djhi added the RFR Ready For Review label Oct 10, 2019
@fzaninotto
Copy link
Member

I think the default export should be DatagridBody, not MemoDatagridBody

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants