-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Performance (datatable): avoiding unnecessary re-render of cells of rows with no state-change #7420
base: master
Are you sure you want to change the base?
Conversation
…odyCell should re-render.
…y avoiding unnecessary re-render of cells. CAREFUL: some bugs detected related to MetaKey which are still not yet fixed.
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
There might still be a bug when the metakey is used for column sorting. I'll verify this later today or tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic just one recommendation
…and getNestedValue from BodyCell.js to ObjectUtils and ran prettier to avoid pull request errors
Is there a chance to implement these modifications in version 10.9.2? |
Defect Fixes
Fix #2979: Datatable performance improved by taking out parameters and functions of the BodyCells and placing in the BodyRow or TableBody components. Also, the set of BodyCell props to be checked when deciding for a re-render in React.memo was improved. This avoids now a lot of unnecessary re-render, including the issue from the linked issue.
Note that I also created a function called "selectiveCompare" in the BodyCell component to make the selection of which props should be checked at the React.memo. Maybe it makes sense to move it to the Utils, since it potentially can be used for optimizing the datatable further and more generally other library components. This selective comparison of the props is important since React.memo will not work as expected mainly if there are objects being parsed in the props.