mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08: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