Skip to content

Commit

Permalink
fix: add condition to messages memoization ruleset (vercel#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyphilemon authored Jan 13, 2025
1 parent c5a57fd commit aa29cc5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions components/messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const Messages = memo(PureMessages, (prevProps, nextProps) => {
if (prevProps.isLoading !== nextProps.isLoading) return false;
if (prevProps.isLoading && nextProps.isLoading) return false;
if (prevProps.messages.length !== nextProps.messages.length) return false;
if (!equal(prevProps.messages, nextProps.messages)) return false;
if (!equal(prevProps.votes, nextProps.votes)) return false;

return true;
Expand Down

0 comments on commit aa29cc5

Please sign in to comment.