-
Notifications
You must be signed in to change notification settings - Fork 143
[CLNP-6022] Memoize useGroupChannel actions to prevent unnecessary re-rendering #1288
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
Conversation
✅ Deploy Preview for sendbird-uikit-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Just wrapped all handlers with useCallback one by one. No logic changes.
| */ | ||
| return false; | ||
| } | ||
| return !isEqual(prevState[key as keyof T], value); |
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.
Changed the way of comparing prev <-> next state with isEqual for deeper comparison like useDeepCompareEffect
src/modules/GroupChannel/components/MessageList/InfiniteList.tsx
Outdated
Show resolved
Hide resolved
f9168a0 to
c1f6bab
Compare
|
I think it's good to merge now! |
Addresses https://sendbird.atlassian.net/browse/CLNP-6022?focusedCommentId=301263
Key changes
Memoized action handlers(+ scroll related functions as well) in useGroupChannel to reduced unnecessary re-rendering.