mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
hotfix(frontend): Prevent too many re-renders (#8670)
This commit is contained in:
@@ -70,6 +70,14 @@ export const Messages: React.FC<MessagesProps> = React.memo(
|
||||
</>
|
||||
);
|
||||
},
|
||||
(prevProps, nextProps) => {
|
||||
// Prevent re-renders if messages are the same length
|
||||
if (prevProps.messages.length !== nextProps.messages.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
);
|
||||
|
||||
Messages.displayName = "Messages";
|
||||
|
||||
Reference in New Issue
Block a user