-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add shouldComponentUpdate
to major components.
#1123
Conversation
#760 1) Add shouldComponentUpdate for ReactGridLayout 2) Add shouldComponentUpdate for GridItem 3) Fix when items are dragging not from own position, but from zero top left
This improves performance quite a bit in most cases, is implemented safely to avoid breakage on equal arrays and objects. To do so, while avoiding the maintenance burden of keeping a keylist in sync with propTypes, we read propTypes using babel-plugin-preval then construct a function to do the fastest possible comparison. This is *a lot* faster than isEqual while avoiding unnecessary comparison of e.g. `children`.
This looks ready to be merged. @STRML are there issues with it? I've tested it and everything seems ok. Need some help with it? |
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.
Really cool! This should be much faster. I've tested it locally and I don't see any issues. Is there a specific area this change could affect?
Nope. Just concerned that it could cause the grid to miss updates in
certain conditions. I haven't found them though.
…On Sun, Feb 16, 2020, 2:04 PM Dimitar Dimitrov ***@***.***> wrote:
***@***.**** approved this pull request.
Really cool! This should be much faster. I've tested it locally and I
don't see any issues. Is there a specific area this change could affect?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1123>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJEKPZTWCDA2KHARZ5MYB3RDGE4RANCNFSM4KGIJUFQ>
.
|
Hi! thanks for great component. But after adding shouldComponentUpdate shallow comparison, when i'am using ResponsiveReactGridLayout it is is won't rendering at all! (obliviously why) i'am using dynamic count of elements with array inside body, like this ->
thanks) |
feat(render): Add shouldComponentUpdate to ReactGridLayout & GridItem.
This improves performance quite a bit in most cases, is implemented safely
to avoid breakage on equal arrays and objects.
To do so, while avoiding the maintenance burden of keeping a keylist
in sync with propTypes, we read propTypes using babel-plugin-preval
then construct a function to do the fastest possible comparison.
This is a lot faster than isEqual while avoiding unnecessary
comparison of e.g.
children
.Supersedes #1032 - pinging @zaykaalexander.