hotfix(frontend): Prevent too many re-renders (#8670)

This commit is contained in:
sp.wack
2025-05-24 13:38:51 +04:00
committed by GitHub
parent 9a5e5956fc
commit b838ea0427

View File

@@ -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";